Skip to content

Commit 4ea1cf1

Browse files
committed
regenerate migration as 0208 after rebase onto staging
1 parent d542dfa commit 4ea1cf1

3 files changed

Lines changed: 16148 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
CREATE TABLE "workspace_file_folders" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"name" text NOT NULL,
4+
"user_id" text NOT NULL,
5+
"workspace_id" text NOT NULL,
6+
"parent_id" text,
7+
"sort_order" integer DEFAULT 0 NOT NULL,
8+
"deleted_at" timestamp,
9+
"created_at" timestamp DEFAULT now() NOT NULL,
10+
"updated_at" timestamp DEFAULT now() NOT NULL
11+
);
12+
--> statement-breakpoint
13+
DROP INDEX "workspace_files_workspace_name_active_unique";--> statement-breakpoint
14+
ALTER TABLE "copilot_chats" ADD COLUMN "pinned" boolean DEFAULT false NOT NULL;--> statement-breakpoint
15+
ALTER TABLE "workspace_files" ADD COLUMN "folder_id" text;--> statement-breakpoint
16+
ALTER TABLE "workspace_file_folders" ADD CONSTRAINT "workspace_file_folders_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
17+
ALTER TABLE "workspace_file_folders" ADD CONSTRAINT "workspace_file_folders_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
18+
ALTER TABLE "workspace_file_folders" ADD CONSTRAINT "workspace_file_folders_parent_id_workspace_file_folders_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."workspace_file_folders"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
19+
CREATE INDEX "workspace_file_folders_workspace_parent_idx" ON "workspace_file_folders" USING btree ("workspace_id","parent_id");--> statement-breakpoint
20+
CREATE INDEX "workspace_file_folders_parent_sort_idx" ON "workspace_file_folders" USING btree ("parent_id","sort_order");--> statement-breakpoint
21+
CREATE INDEX "workspace_file_folders_deleted_at_idx" ON "workspace_file_folders" USING btree ("deleted_at");--> statement-breakpoint
22+
CREATE INDEX "workspace_file_folders_workspace_deleted_partial_idx" ON "workspace_file_folders" USING btree ("workspace_id","deleted_at") WHERE "workspace_file_folders"."deleted_at" IS NOT NULL;--> statement-breakpoint
23+
CREATE UNIQUE INDEX "workspace_file_folders_workspace_parent_name_active_unique" ON "workspace_file_folders" USING btree ("workspace_id",coalesce("parent_id", ''),"name") WHERE "workspace_file_folders"."deleted_at" IS NULL;--> statement-breakpoint
24+
ALTER TABLE "workspace_files" ADD CONSTRAINT "workspace_files_folder_id_workspace_file_folders_id_fk" FOREIGN KEY ("folder_id") REFERENCES "public"."workspace_file_folders"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
25+
CREATE UNIQUE INDEX "workspace_files_workspace_folder_name_active_unique" ON "workspace_files" USING btree ("workspace_id",coalesce("folder_id", ''),"original_name") WHERE "workspace_files"."deleted_at" IS NULL AND "workspace_files"."context" = 'workspace' AND "workspace_files"."workspace_id" IS NOT NULL;--> statement-breakpoint
26+
CREATE INDEX "workspace_files_folder_id_idx" ON "workspace_files" USING btree ("folder_id");

0 commit comments

Comments
 (0)