mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
task: added unique index for release plan templates (#8846)
We want to prevent our users from defining multiple templates with the same name. So this adds a unique index on the name column when discriminator is template.
This commit is contained in:
parent
4f87f1e0b9
commit
0f76a8a5a6
@ -0,0 +1,15 @@
|
||||
exports.up = function (db, cb) {
|
||||
db.runSql(
|
||||
`CREATE UNIQUE INDEX idx_uniq_release_plan_definitions_discriminator_template
|
||||
ON release_plan_definitions(name)
|
||||
WHERE discriminator = 'template'`,
|
||||
cb,
|
||||
);
|
||||
};
|
||||
|
||||
exports.down = function (db, cb) {
|
||||
db.runSql(
|
||||
`DROP INDEX IF EXISTS idx_uniq_release_plan_definitions_discriminator_template`,
|
||||
cb,
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user