Skip to content

Commit

Permalink
chore: add migration using expand/contract pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheartman committed Jan 9, 2024
1 parent 5c0cc48 commit 0d28f22
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/migrations/20240109095348-add-reason-column-to-schedule.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

exports.up = function (db, cb) {
db.runSql(
`ALTER TABLE change_request_schedule ADD COLUMN reason TEXT;
UPDATE change_request_schedule SET reason = failure_reason;`,
cb,
);
};

exports.down = function (db, cb) {
db.runSql(
`ALTER TABLE change_request_schedule DROP COLUMN failure_reason;`,
cb,
);
};

0 comments on commit 0d28f22

Please sign in to comment.