1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-04 00:18:01 +01:00

fix: Enforce non-nullability of environment type (#950)

* fix: Enforce non-nullability of environment type
This commit is contained in:
Christopher Kolstad 2021-09-24 09:11:36 +02:00 committed by GitHub
parent 132e801836
commit 0bca321219
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,14 @@
'use strict';
exports.up = function (db, cb) {
db.runSql(
`
UPDATE environments SET type = 'production' WHERE type IS null;
ALTER TABLE environments ALTER COLUMN type SET NOT NULL`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(`ALTER TABLE environments ALTER COLUMN type DROP NOT NULL`, cb);
};

View File

@ -8,7 +8,7 @@ let app;
let db;
beforeAll(async () => {
db = await dbInit('metrics_api_client', getLogger);
db = await dbInit('metrics_api_e2e_access_client', getLogger);
app = await setupAppWithAuth(db.stores);
});