1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-26 13:48:33 +02:00

fix: roles should have unique name

This commit is contained in:
Ivar Conradi Østhus 2022-01-11 13:32:46 +01:00
parent 876abe405c
commit 7a71f01e83
No known key found for this signature in database
GPG Key ID: 31AC596886B0BD09

View File

@ -0,0 +1,17 @@
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE roles ADD CONSTRAINT unique_name UNIQUE (name);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
ALTER TABLE roles DROP CONSTRAINT unique_name;
`,
cb,
);
};