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:
parent
24a7b5146e
commit
11f4155d5a
18
src/migrations/20240329064629-revert-feature-archived.js
Normal file
18
src/migrations/20240329064629-revert-feature-archived.js
Normal 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,
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user