Skip to content

Commit

Permalink
make approvals unique (#2534)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew committed Nov 28, 2022
1 parent ad19779 commit 68162c2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/migrations/20221125185244-change-request-unique-approvals.js
@@ -0,0 +1,17 @@
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE change_request_approvals ADD CONSTRAINT unique_approvals UNIQUE (change_request_id, created_by);
`,
cb,
);
};

exports.down = function (db, cb) {
db.runSql(
`
ALTER TABLE change_request_approvals DROP CONSTRAINT unique_approvals;
`,
cb,
);
};

0 comments on commit 68162c2

Please sign in to comment.