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:
parent
876abe405c
commit
7a71f01e83
17
src/migrations/20220111120346-roles-unique-name.js
Normal file
17
src/migrations/20220111120346-roles-unique-name.js
Normal 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,
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user