Use cascaded deletes
When we delete a user we should delete all the notes that belong to this user including the revisions of these notes. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
@@ -102,7 +102,9 @@ module.exports = function (sequelize, DataTypes) {
|
||||
Revision.belongsTo(models.Note, {
|
||||
foreignKey: 'noteId',
|
||||
as: 'note',
|
||||
constraints: false
|
||||
constraints: false,
|
||||
onDelete: 'CASCADE',
|
||||
hooks: true
|
||||
})
|
||||
},
|
||||
getNoteRevisions: function (note, callback) {
|
||||
|
||||
Reference in New Issue
Block a user