mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-03 05:32:06 -05:00
chore: remove duplicate migration and revert schema reordering
The ApiKeyEnvironment.workspaceId column, foreign key, index, and backfill were already handled by earlier migrations (20260401000000, 20260401000001, 20260402000000). The phase 6 migration was redundant and would fail at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "ApiKeyEnvironment" ADD COLUMN "workspaceId" TEXT;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "ApiKeyEnvironment" ADD CONSTRAINT "ApiKeyEnvironment_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "ApiKeyEnvironment_workspaceId_idx" ON "ApiKeyEnvironment"("workspaceId");
|
||||
|
||||
-- Backfill workspaceId from Environment table
|
||||
UPDATE "ApiKeyEnvironment" ake
|
||||
SET "workspaceId" = e."workspaceId"
|
||||
FROM "Environment" e
|
||||
WHERE ake."environmentId" = e."id"
|
||||
AND ake."workspaceId" IS NULL;
|
||||
@@ -669,7 +669,6 @@ model Workspace {
|
||||
workspaceTeams WorkspaceTeam[]
|
||||
customHeadScripts String? // Custom HTML scripts for link surveys (self-hosted only)
|
||||
feedbackRecordDirectoryWorkspaces FeedbackRecordDirectoryWorkspace[]
|
||||
apiKeyEnvironments ApiKeyEnvironment[]
|
||||
|
||||
// Direct resource relations (for environment deprecation migration)
|
||||
surveys Survey[]
|
||||
@@ -680,6 +679,7 @@ model Workspace {
|
||||
tags Tag[]
|
||||
segments Segment[]
|
||||
integrations Integration[]
|
||||
apiKeyEnvironments ApiKeyEnvironment[]
|
||||
|
||||
@@unique([organizationId, name])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user