2021-04-22 13:33:35 +02:00
|
|
|
'use strict';
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
exports.up = function (db, cb) {
|
2021-04-22 13:33:35 +02:00
|
|
|
db.runSql(
|
|
|
|
`
|
|
|
|
ALTER TABLE strategies ADD COLUMN sort_order integer DEFAULT 9999;
|
|
|
|
UPDATE strategies SET sort_order = 0 WHERE name = 'default';
|
|
|
|
UPDATE strategies SET sort_order = 1 WHERE name = 'flexibleRollout';
|
|
|
|
UPDATE strategies SET sort_order = 2 WHERE name = 'userWithId';
|
|
|
|
UPDATE strategies SET sort_order = 3 WHERE name = 'remoteAddress';
|
|
|
|
UPDATE strategies SET sort_order = 4 WHERE name = 'applicationHostname';
|
|
|
|
`,
|
|
|
|
cb,
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2021-08-12 15:04:37 +02:00
|
|
|
exports.down = function (db, cb) {
|
|
|
|
db.runSql('ALTER TABLE strategies DROP COLUMN sort_order;', cb);
|
2021-04-22 13:33:35 +02:00
|
|
|
};
|