Skip to content

Commit

Permalink
feat(db): user email un-subscription (#8612)
Browse files Browse the repository at this point in the history
Opt-out table for emails
  • Loading branch information
Tymek authored Oct 31, 2024
1 parent ca307b2 commit 28f821c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/migrations/20241031102325-user-unsubscription.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
exports.up = function(db, cb) {
db.runSql(`
CREATE TABLE IF NOT EXISTS user_unsubscription
(
user_id INTEGER NOT NULL references users (id),
subscription VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT now(),
PRIMARY KEY (user_id, subscription)
);
`, cb);
};

exports.down = function(db, cb) {
db.runSql(`DROP TABLE IF EXISTS user_unsubscription;`, cb);
};

0 comments on commit 28f821c

Please sign in to comment.