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

fix: revert archived column for backwards migration compatibility (#6737)

This commit is contained in:
Mateusz Kwasniewski 2024-03-29 13:00:33 +01:00 committed by GitHub
parent 24a7b5146e
commit 11f4155d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,18 @@
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE features ADD COLUMN IF NOT EXISTS archived BOOLEAN DEFAULT FALSE;
UPDATE features SET archived = (archived_at IS NOT NULL);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
ALTER TABLE features DROP COLUMN IF EXISTS archived;
`,
cb,
);
};