Skip to content

Commit abf9bf7

Browse files
committed
fix(db): rebase assistant migration and preserve atomic expansion
1 parent aeaa25b commit abf9bf7

3 files changed

Lines changed: 31422 additions & 8 deletions

File tree

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "executable_name" text;--> statement-breakpoint
2-
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "target_workspace_id" text;--> statement-breakpoint
3-
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "approved_args" jsonb;--> statement-breakpoint
4-
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "execution_retryable" boolean DEFAULT true NOT NULL;
5-
--> statement-breakpoint
1+
-- Earlier concurrent-index migrations end the batch transaction; keep this expansion and its journal row atomic.
2+
BEGIN;--> statement-breakpoint
63
CREATE TABLE "assistant_tool_permission" (
74
"organization_id" text NOT NULL,
85
"user_id" text NOT NULL,
@@ -17,10 +14,13 @@ CREATE TABLE "assistant_tool_permission" (
1714
CONSTRAINT "assistant_tool_permission_revision_check" CHECK ("assistant_tool_permission"."revision" > 0)
1815
);
1916
--> statement-breakpoint
17+
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "executable_name" text;--> statement-breakpoint
18+
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "target_workspace_id" text;--> statement-breakpoint
19+
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "approved_args" jsonb;--> statement-breakpoint
20+
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "assistant_action" jsonb;--> statement-breakpoint
21+
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "execution_retryable" boolean DEFAULT true NOT NULL;--> statement-breakpoint
2022
ALTER TABLE "assistant_tool_permission" ADD CONSTRAINT "assistant_tool_permission_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
2123
ALTER TABLE "assistant_tool_permission" ADD CONSTRAINT "assistant_tool_permission_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
2224
ALTER TABLE "assistant_tool_permission" ADD CONSTRAINT "assistant_tool_permission_credential_id_credential_id_fk" FOREIGN KEY ("credential_id") REFERENCES "public"."credential"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
2325
CREATE INDEX "assistant_tool_permission_credential_idx" ON "assistant_tool_permission" USING btree ("credential_id");--> statement-breakpoint
24-
CREATE INDEX "assistant_tool_permission_user_idx" ON "assistant_tool_permission" USING btree ("user_id");
25-
--> statement-breakpoint
26-
ALTER TABLE "copilot_async_tool_calls" ADD COLUMN "assistant_action" jsonb;
26+
CREATE INDEX "assistant_tool_permission_user_idx" ON "assistant_tool_permission" USING btree ("user_id");

0 commit comments

Comments
 (0)