Skip to content

Commit 4b2932a

Browse files
committed
Fixed the migration that created the new idempotency key index on BatchTaskRun
1 parent eac6aa7 commit 4b2932a

File tree

2 files changed

+15
-11
lines changed
  • internal-packages/database/prisma/migrations
    • 20241120161204_modify_batch_task_run_for_improvements
    • 20241120161205_add_new_unique_index_on_batch_task_run

2 files changed

+15
-11
lines changed
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
/*
2-
Warnings:
3-
4-
- A unique constraint covering the columns `[runtimeEnvironmentId,idempotencyKey]` on the table `BatchTaskRun` will be added. If there are existing duplicate values, this will fail.
5-
6-
*/
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[runtimeEnvironmentId,idempotencyKey]` on the table `BatchTaskRun` will be added. If there are existing duplicate values, this will fail.
5+
6+
*/
77
-- DropIndex
88
DROP INDEX "BatchTaskRun_runtimeEnvironmentId_taskIdentifier_idempotenc_key";
99

1010
-- AlterTable
11-
ALTER TABLE "BatchTaskRun" ADD COLUMN "runCount" INTEGER NOT NULL DEFAULT 0,
12-
ADD COLUMN "runIds" TEXT[] DEFAULT ARRAY[]::TEXT[],
13-
ALTER COLUMN "taskIdentifier" DROP NOT NULL;
14-
15-
-- CreateIndex
16-
CREATE UNIQUE INDEX "BatchTaskRun_runtimeEnvironmentId_idempotencyKey_key" ON "BatchTaskRun"("runtimeEnvironmentId", "idempotencyKey");
11+
ALTER TABLE
12+
"BatchTaskRun"
13+
ADD
14+
COLUMN "runCount" INTEGER NOT NULL DEFAULT 0,
15+
ADD
16+
COLUMN "runIds" TEXT [] DEFAULT ARRAY [] :: TEXT [],
17+
ALTER COLUMN
18+
"taskIdentifier" DROP NOT NULL;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS "BatchTaskRun_runtimeEnvironmentId_idempotencyKey_key" ON "BatchTaskRun"("runtimeEnvironmentId", "idempotencyKey");

0 commit comments

Comments
 (0)