mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-03-03 11:36:08 +08:00
[local-sync] Don't delete messages via cascade when a folder is deleted
1. It could be expensive to delete many messages at the exact moment when the folder is deleted 2. The folder delete could actually just be a rename, and if we deleted all the messages, we would have to re-process them all 3. We already do a clean-up check for orphaned messages at the end of the sync loop, where we already know if the folder was actually deleted or just renamed
This commit is contained in:
parent
b03c0c9bc2
commit
1e6f7a6e6f
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ module.exports = (sequelize, Sequelize) => {
|
|||
}, {
|
||||
classMethods: {
|
||||
associate({Folder, Message, Thread}) {
|
||||
Folder.hasMany(Message, {onDelete: 'cascade', hooks: true})
|
||||
Folder.hasMany(Message)
|
||||
Folder.belongsToMany(Thread, {through: 'thread_folders'})
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue