Skip to content

Commit 153acec

Browse files
committed
feat: update todos & categories under authed and dashboard
1 parent eb1305f commit 153acec

File tree

23 files changed

+1160
-91
lines changed

23 files changed

+1160
-91
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- Add user_id columns to existing tables
2+
-- Since we're adding NOT NULL columns to potentially existing data,
3+
-- we need to handle this carefully
4+
5+
-- First, add the columns as nullable
6+
ALTER TABLE `categories` ADD `user_id` text REFERENCES user(id);
7+
ALTER TABLE `todos` ADD `user_id` text REFERENCES user(id);
8+
9+
-- Note: In a production environment, you would need to:
10+
-- 1. Populate these columns with appropriate user IDs for existing data
11+
-- 2. Then make them NOT NULL in a separate migration
12+
-- For development, you might want to clear existing data or assign a default user
13+
14+
-- For now, we'll leave them nullable and handle the constraint in application code
15+
-- until existing data is properly migrated

0 commit comments

Comments
 (0)