Skip to content

Commit

Permalink
fix: revert archived column for backwards migration compatibility (#6737
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kwasniew committed Mar 29, 2024
1 parent 24a7b51 commit 11f4155
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/migrations/20240329064629-revert-feature-archived.js
@@ -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,
);
};

0 comments on commit 11f4155

Please sign in to comment.