diff --git a/src/migrations/20210928080601-add-development-and-production-environments.js b/src/migrations/20210928080601-add-development-and-production-environments.js index e7769a0dd5..b4571d1d09 100644 --- a/src/migrations/20210928080601-add-development-and-production-environments.js +++ b/src/migrations/20210928080601-add-development-and-production-environments.js @@ -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, ); diff --git a/src/migrations/20211029094324-set-sort-order-env.js b/src/migrations/20211029094324-set-sort-order-env.js new file mode 100644 index 0000000000..c70a48372f --- /dev/null +++ b/src/migrations/20211029094324-set-sort-order-env.js @@ -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(); +};