-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fixing route selection and creating tasks with no asignee
- Loading branch information
Showing
7 changed files
with
508 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
PRAGMA foreign_keys=OFF;--> statement-breakpoint | ||
CREATE TABLE `__new_project` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`workspace_id` text NOT NULL, | ||
`slug` text NOT NULL, | ||
`icon` text DEFAULT 'Layout', | ||
`name` text NOT NULL, | ||
`description` text, | ||
`created_at` integer DEFAULT '"2025-02-11T18:12:00.369Z"' NOT NULL, | ||
FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_project`("id", "workspace_id", "slug", "icon", "name", "description", "created_at") SELECT "id", "workspace_id", "slug", "icon", "name", "description", "created_at" FROM `project`;--> statement-breakpoint | ||
DROP TABLE `project`;--> statement-breakpoint | ||
ALTER TABLE `__new_project` RENAME TO `project`;--> statement-breakpoint | ||
PRAGMA foreign_keys=ON;--> statement-breakpoint | ||
CREATE TABLE `__new_task` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`project_id` text NOT NULL, | ||
`number` integer DEFAULT 1, | ||
`assignee_email` text, | ||
`title` text NOT NULL, | ||
`description` text, | ||
`status` text DEFAULT 'to-do' NOT NULL, | ||
`priority` text DEFAULT 'low', | ||
`due_date` integer, | ||
`created_at` integer DEFAULT '"2025-02-11T18:12:00.369Z"' NOT NULL, | ||
FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON UPDATE cascade ON DELETE cascade, | ||
FOREIGN KEY (`assignee_email`) REFERENCES `user`(`email`) ON UPDATE cascade ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_task`("id", "project_id", "number", "assignee_email", "title", "description", "status", "priority", "due_date", "created_at") SELECT "id", "project_id", "number", "assignee_email", "title", "description", "status", "priority", "due_date", "created_at" FROM `task`;--> statement-breakpoint | ||
DROP TABLE `task`;--> statement-breakpoint | ||
ALTER TABLE `__new_task` RENAME TO `task`;--> statement-breakpoint | ||
CREATE TABLE `__new_user` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`password` text NOT NULL, | ||
`email` text NOT NULL, | ||
`created_at` integer DEFAULT '"2025-02-11T18:12:00.368Z"' NOT NULL | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_user`("id", "name", "password", "email", "created_at") SELECT "id", "name", "password", "email", "created_at" FROM `user`;--> statement-breakpoint | ||
DROP TABLE `user`;--> statement-breakpoint | ||
ALTER TABLE `__new_user` RENAME TO `user`;--> statement-breakpoint | ||
CREATE UNIQUE INDEX `user_email_unique` ON `user` (`email`);--> statement-breakpoint | ||
CREATE TABLE `__new_workspace` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`name` text NOT NULL, | ||
`description` text, | ||
`owner_email` text NOT NULL, | ||
`created_at` integer DEFAULT '"2025-02-11T18:12:00.368Z"' NOT NULL, | ||
FOREIGN KEY (`owner_email`) REFERENCES `user`(`email`) ON UPDATE cascade ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_workspace`("id", "name", "description", "owner_email", "created_at") SELECT "id", "name", "description", "owner_email", "created_at" FROM `workspace`;--> statement-breakpoint | ||
DROP TABLE `workspace`;--> statement-breakpoint | ||
ALTER TABLE `__new_workspace` RENAME TO `workspace`;--> statement-breakpoint | ||
CREATE TABLE `__new_workspace_member` ( | ||
`id` text PRIMARY KEY NOT NULL, | ||
`workspace_id` text NOT NULL, | ||
`user_email` text NOT NULL, | ||
`role` text, | ||
`joined_at` integer DEFAULT '"2025-02-11T18:12:00.369Z"' NOT NULL, | ||
FOREIGN KEY (`workspace_id`) REFERENCES `workspace`(`id`) ON UPDATE cascade ON DELETE cascade, | ||
FOREIGN KEY (`user_email`) REFERENCES `user`(`email`) ON UPDATE cascade ON DELETE cascade | ||
); | ||
--> statement-breakpoint | ||
INSERT INTO `__new_workspace_member`("id", "workspace_id", "user_email", "role", "joined_at") SELECT "id", "workspace_id", "user_email", "role", "joined_at" FROM `workspace_member`;--> statement-breakpoint | ||
DROP TABLE `workspace_member`;--> statement-breakpoint | ||
ALTER TABLE `__new_workspace_member` RENAME TO `workspace_member`; |
Oops, something went wrong.