Skip to content

Commit

Permalink
DB Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Jun 21, 2024
1 parent 78897fd commit 9b10361
Show file tree
Hide file tree
Showing 3 changed files with 1,777 additions and 0 deletions.
18 changes: 18 additions & 0 deletions api/migrations/0049_parched_mandarin.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
Unfortunately in current drizzle-kit version we can't automatically get name for primary key.
We are working on making it available!
Meanwhile you can:
1. Check pk name in your database, by running
SELECT constraint_name FROM information_schema.table_constraints
WHERE table_schema = 'public'
AND table_name = 'tasks'
AND constraint_type = 'PRIMARY KEY';
2. Uncomment code below and paste pk name manually
Hope to release this update as soon as possible
*/

-- ALTER TABLE "tasks" DROP CONSTRAINT "<constraint_name>";--> statement-breakpoint
ALTER TABLE "tasks" ADD COLUMN "id" text NOT NULL;--> statement-breakpoint
ALTER TABLE "tasks" ADD CONSTRAINT "tasks_prefix_unique" UNIQUE("prefix");
Loading

0 comments on commit 9b10361

Please sign in to comment.