diff --git a/src/migrations/20241125080935-add-unique-idx-to-release-plan-discriminator.js b/src/migrations/20241125080935-add-unique-idx-to-release-plan-discriminator.js new file mode 100644 index 000000000000..e67e7137d8ff --- /dev/null +++ b/src/migrations/20241125080935-add-unique-idx-to-release-plan-discriminator.js @@ -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, + ); +};