1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: add default sort order for built in envs (#1076)

This commit is contained in:
Ivar Conradi Østhus 2021-10-29 13:02:05 +02:00 committed by GitHub
parent b04b6b3ef7
commit 59f1c6e8e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -3,9 +3,9 @@
exports.up = function (db, cb) {
db.runSql(
`
INSERT INTO environments(name, type, enabled)
VALUES ('development', 'development', true),
('production', 'production', true);
INSERT INTO environments(name, type, enabled, sort_order)
VALUES ('development', 'development', true, 100),
('production', 'production', true, 200);
`,
cb,
);

View File

@ -0,0 +1,15 @@
'use strict';
exports.up = function (db, cb) {
db.runSql(
`
UPDATE environments set sort_order = 100 where name = 'development' AND sort_order = 9999;
UPDATE environments set sort_order = 200 where name = 'production' AND sort_order = 9999;
`,
cb,
);
};
exports.down = function (db, cb) {
cb();
};