Two problems about SQLite

Hello, I am now using drizzle + turso in my new side project, and I encountered two problems: 1. I have a table storing several users data, and if I want to add new column to increase user’s attribute, how can I add it but without deleting all the existing data? 2. I have to table users and tasks, how can I define schema to define a new column in users call “ownTasks” which is an array of several tasks?
1 Reply
Angelelz
Angelelz12mo ago
1. If you create the new column as nullable or with a default value, you don't have to do anything 2. This is a one-to-many relation. Normally you would add a foreing key to the "many table" (tasks), like user_id or owner_id that references the if of the "one table" (users)
Want results from more Discord servers?
Add your server