Cascade notification setting deletion on user account deletion

This commit is contained in:
Tom Moor
2018-12-06 19:14:43 -08:00
parent 9ca0038d39
commit 06e7ab84cd
3 changed files with 21 additions and 27 deletions

View File

@ -52,6 +52,7 @@ NotificationSetting.associate = models => {
NotificationSetting.belongsTo(models.User, {
as: 'user',
foreignKey: 'userId',
onDelete: 'cascade',
});
NotificationSetting.belongsTo(models.Team, {
as: 'team',