1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/src/migrations/20241031102325-user-unsubscription.js
Tymoteusz Czech 28f821cb34
feat(db): user email un-subscription (#8612)
Opt-out table for emails
2024-10-31 11:38:15 +00:00

16 lines
413 B
JavaScript

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);
};