1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/migrations/20220405103233-add-segments-name-index.js
Nuno Góis 794327f8e0
fix: reject duplicate segment names (#1475)
* fix: reject duplicate segment names

* refactor: remove unnecessary comment

* refactor: improve validateName logic with existsByName

* fix: removed unused NotFoundError import
2022-04-06 14:01:50 +01:00

20 lines
301 B
JavaScript

'use strict';
exports.up = function (db, cb) {
db.runSql(
`
create index segments_name_index on segments (name);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
drop index segments_name_index;
`,
cb,
);
};