0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00
ghost/core/server/models
Katharina Irrgang 9349e99e54 🐛 fix delete by author as transaction (#7145)
closes #7137

Deleting the content from the database runs in a transaction. see
https://github.com/TryGhost/Ghost/blob/master/core/server/api/users.js#L390

`destroyByAuthor` is one of the operations we trigger to delete all the conent, see https://github.com/TryGhost/Ghost/blob/master/core/server/models/post.js#L647

The post model has a specific hook for deleting content to delete the relations as well, see https://github.com/TryGhost/Ghost/blob/master/core/server/models/post.js#L122

This hook is part of the transaction. But the `options` are ignored. `(model/*, attr, options*/)` 
We use the `options` to forward the transaction reference, which we need to pass into the bookshelf queries. So `return model.load('tags').call('related', 'tags').call('detach')` does not forward the transaction and that's why it stucks when deleting the content.
2016-09-19 14:45:36 +01:00
..
base 🐛 fix delete by author as transaction (#7145) 2016-09-19 14:45:36 +01:00
plugins change default order of posts (#7096) 2016-07-15 11:04:10 +01:00
accesstoken.js Add token added event, update last_login 2016-06-09 09:17:06 +01:00
app-field.js Misc cleanup: moving files & naming functions 2015-06-15 09:43:19 +01:00
app-setting.js Misc cleanup: moving files & naming functions 2015-06-15 09:43:19 +01:00
app.js Misc cleanup: moving files & naming functions 2015-06-15 09:43:19 +01:00
client-trusted-domain.js Add table columns for OAuth 2015-09-02 13:39:22 +01:00
client.js post-scheduling 2016-06-14 10:52:13 +02:00
index.js feature: when timezone changes, reschedule all posts 2016-06-10 14:58:19 +02:00
permission.js Misc cleanup: moving files & naming functions 2015-06-15 09:43:19 +01:00
post.js 🐛 fix delete by author as transaction (#7145) 2016-09-19 14:45:36 +01:00
refreshtoken.js Misc cleanup: moving files & naming functions 2015-06-15 09:43:19 +01:00
role.js deps: lodash@4.13.1 2016-06-11 13:13:55 -06:00
settings.js improvement: migrations (#7000) 2016-07-14 11:59:42 +01:00
subscriber.js subscribers: fix adding subscriber from admin if collection is empty 2016-05-11 19:23:44 +02:00
tag.js internal tags feature 2016-06-11 09:12:04 -06:00
user.js deps: lodash@4.13.1 2016-06-11 13:13:55 -06:00