Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drizzle/0003_happy_starhawk.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE `project` (
`id` text PRIMARY KEY NOT NULL,
`name` text NOT NULL,
`slug` text NOT NULL,
`teamId` text NOT NULL,
`created_at` integer DEFAULT (cast(unixepoch('subsecond') * 1000 as integer)) NOT NULL,
FOREIGN KEY (`teamId`) REFERENCES `team`(`id`) ON UPDATE no action ON DELETE cascade
);
--> statement-breakpoint
CREATE UNIQUE INDEX `project_teamId_slug_unique` ON `project` (`teamId`,`slug`);
4 changes: 4 additions & 0 deletions drizzle/0004_kind_vision.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE `project` RENAME COLUMN "teamId" TO "team_id";--> statement-breakpoint
DROP INDEX `project_teamId_slug_unique`;--> statement-breakpoint
CREATE UNIQUE INDEX `project_team_id_slug_unique` ON `project` (`team_id`,`slug`);--> statement-breakpoint
ALTER TABLE `project` ALTER COLUMN "team_id" TO "team_id" text NOT NULL REFERENCES team(id) ON DELETE cascade ON UPDATE no action;
Loading
Loading