-
-
Notifications
You must be signed in to change notification settings - Fork 708
Add unique indexes for the oneTimeUseToken columns #1517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Warnings: | ||
|
||
- A unique constraint covering the columns `[oneTimeUseToken]` on the table `TaskRun` will be added. If there are existing duplicate values, this will fail. | ||
|
||
*/ | ||
-- CreateIndex | ||
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS "TaskRun_oneTimeUseToken_key" ON "TaskRun"("oneTimeUseToken"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
Warnings: | ||
|
||
- A unique constraint covering the columns `[oneTimeUseToken]` on the table `BatchTaskRun` will be added. If there are existing duplicate values, this will fail. | ||
|
||
*/ | ||
-- CreateIndex | ||
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS "BatchTaskRun_oneTimeUseToken_key" ON "BatchTaskRun"("oneTimeUseToken"); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1723,7 +1723,6 @@ model TaskRun { | |
maxAttempts Int? | ||
|
||
/// optional token that can be used to authenticate the task run | ||
/// TODO: add a unique constraint on the token | ||
oneTimeUseToken String? | ||
|
||
batchItems BatchTaskRunItem[] | ||
|
@@ -1791,8 +1790,7 @@ model TaskRun { | |
|
||
maxDurationInSeconds Int? | ||
|
||
// TODO: uncomment this | ||
// @@unique([oneTimeUseToken]) | ||
@@unique([oneTimeUseToken]) | ||
@@unique([runtimeEnvironmentId, taskIdentifier, idempotencyKey]) | ||
// Finding child runs | ||
@@index([parentTaskRunId]) | ||
|
@@ -2168,7 +2166,6 @@ model BatchTaskRun { | |
batchVersion String @default("v1") | ||
|
||
/// optional token that can be used to authenticate the task run | ||
/// TODO: add a unique constraint on the token | ||
oneTimeUseToken String? | ||
|
||
///all the below properties are engine v1 only | ||
|
@@ -2180,8 +2177,7 @@ model BatchTaskRun { | |
dependentTaskAttemptId String? | ||
runDependencies TaskRunDependency[] @relation("dependentBatchRun") | ||
|
||
// TODO: uncomment this | ||
// @@unique([oneTimeUseToken]) | ||
@@unique([oneTimeUseToken]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure existing data complies with the new unique constraint on Similar to the |
||
///this is used for all engine versions | ||
@@unique([runtimeEnvironmentId, idempotencyKey]) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure existing data complies with the new unique constraint on
oneTimeUseToken
inTaskRun
.Adding a unique constraint to the
oneTimeUseToken
field enforces data integrity and uniqueness. However, if there are existing duplicate values in this column, the migration will fail. Please verify that the existing data does not contain duplicates before applying this change.