mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-18 18:25:14 -05:00
v0
This commit is contained in:
4
packages/db/migrations/0155_cuddly_slapstick.sql
Normal file
4
packages/db/migrations/0155_cuddly_slapstick.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
ALTER TABLE "copilot_chats" ALTER COLUMN "workflow_id" DROP NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "copilot_chats" ADD COLUMN "workspace_id" text;--> statement-breakpoint
|
||||
ALTER TABLE "copilot_chats" ADD CONSTRAINT "copilot_chats_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE INDEX "copilot_chats_user_workspace_idx" ON "copilot_chats" USING btree ("user_id","workspace_id");
|
||||
11512
packages/db/migrations/meta/0155_snapshot.json
Normal file
11512
packages/db/migrations/meta/0155_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1079,6 +1079,13 @@
|
||||
"when": 1770869658697,
|
||||
"tag": "0154_bumpy_living_mummy",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 155,
|
||||
"version": "7",
|
||||
"when": 1771370340147,
|
||||
"tag": "0155_cuddly_slapstick",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1499,9 +1499,8 @@ export const copilotChats = pgTable(
|
||||
userId: text('user_id')
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: 'cascade' }),
|
||||
workflowId: text('workflow_id')
|
||||
.notNull()
|
||||
.references(() => workflow.id, { onDelete: 'cascade' }),
|
||||
workflowId: text('workflow_id').references(() => workflow.id, { onDelete: 'cascade' }),
|
||||
workspaceId: text('workspace_id').references(() => workspace.id, { onDelete: 'cascade' }),
|
||||
title: text('title'),
|
||||
messages: jsonb('messages').notNull().default('[]'),
|
||||
model: text('model').notNull().default('claude-3-7-sonnet-latest'),
|
||||
@@ -1518,6 +1517,12 @@ export const copilotChats = pgTable(
|
||||
workflowIdIdx: index('copilot_chats_workflow_id_idx').on(table.workflowId),
|
||||
userWorkflowIdx: index('copilot_chats_user_workflow_idx').on(table.userId, table.workflowId),
|
||||
|
||||
// Workspace access pattern
|
||||
userWorkspaceIdx2: index('copilot_chats_user_workspace_idx').on(
|
||||
table.userId,
|
||||
table.workspaceId
|
||||
),
|
||||
|
||||
// Ordering indexes
|
||||
createdAtIdx: index('copilot_chats_created_at_idx').on(table.createdAt),
|
||||
updatedAtIdx: index('copilot_chats_updated_at_idx').on(table.updatedAt),
|
||||
|
||||
Reference in New Issue
Block a user