1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-11 00:08:30 +01:00

migration(producitivty-report): cascade user unsubscription (#8655)

Remove opt-outs for deleted users. This is useful in tests, where we
delete users permanently.
This commit is contained in:
Tymoteusz Czech 2024-11-05 13:54:32 +01:00 committed by GitHub
parent ef8417a08d
commit 471cb796c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,16 @@
exports.up = function (db, cb) {
db.runSql(
`
ALTER TABLE user_unsubscription DROP CONSTRAINT user_unsubscription_user_id_fkey;
ALTER TABLE user_unsubscription
ADD CONSTRAINT user_unsubscription_user_id_fkey
FOREIGN KEY (user_id)
REFERENCES users(id) ON DELETE CASCADE;
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql('', cb);
};