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:
Dhruwang
2026-04-03 11:54:54 +05:30
parent ce5f8c928b
commit 418301ed10
2 changed files with 1 additions and 16 deletions

View File

@@ -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;

View File

@@ -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])
}