mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
🐛 Fixed error when deleting a member that has received a newsletter email
closes https://github.com/TryGhost/Ghost/issues/12493 - bumps `bookshelf-relations` to new version that allows for `hasMany` children to be kept when a parent record is destroyed - adds necessary config to the `Member.email_recipients` relationship to keep related records when a member is deleted
This commit is contained in:
parent
bc6df8cebe
commit
eccd220461
3 changed files with 13 additions and 5 deletions
|
@ -19,6 +19,14 @@ const Member = ghostBookshelf.Model.extend({
|
||||||
|
|
||||||
relationships: ['labels', 'stripeCustomers', 'email_recipients'],
|
relationships: ['labels', 'stripeCustomers', 'email_recipients'],
|
||||||
|
|
||||||
|
// do not delete email_recipients records when a member is destroyed. Recipient
|
||||||
|
// records are used for analytics and historical records
|
||||||
|
relationshipConfig: {
|
||||||
|
email_recipients: {
|
||||||
|
destroyRelated: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
relationshipBelongsTo: {
|
relationshipBelongsTo: {
|
||||||
labels: 'labels',
|
labels: 'labels',
|
||||||
stripeCustomers: 'members_stripe_customers',
|
stripeCustomers: 'members_stripe_customers',
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
"bluebird": "3.7.2",
|
"bluebird": "3.7.2",
|
||||||
"body-parser": "1.19.0",
|
"body-parser": "1.19.0",
|
||||||
"bookshelf": "0.15.2",
|
"bookshelf": "0.15.2",
|
||||||
"bookshelf-relations": "1.3.2",
|
"bookshelf-relations": "1.4.0",
|
||||||
"brute-knex": "4.0.1",
|
"brute-knex": "4.0.1",
|
||||||
"bson-objectid": "1.3.1",
|
"bson-objectid": "1.3.1",
|
||||||
"bthreads": "0.5.1",
|
"bthreads": "0.5.1",
|
||||||
|
|
|
@ -1366,10 +1366,10 @@ body@^5.1.0:
|
||||||
raw-body "~1.1.0"
|
raw-body "~1.1.0"
|
||||||
safe-json-parse "~1.0.1"
|
safe-json-parse "~1.0.1"
|
||||||
|
|
||||||
bookshelf-relations@1.3.2:
|
bookshelf-relations@1.4.0:
|
||||||
version "1.3.2"
|
version "1.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/bookshelf-relations/-/bookshelf-relations-1.3.2.tgz#bceb0ab3b172b01a48a81eed16cd68446975515a"
|
resolved "https://registry.yarnpkg.com/bookshelf-relations/-/bookshelf-relations-1.4.0.tgz#88f7f53b0417d99a6a2a53b386e71fd0b113df6e"
|
||||||
integrity sha512-LrsWiO3kKfYCTGWxCVzFuEi/hIfukRz6n3KIcQqCFaAO/PmYxFtxarMGeVKDpL/hm1BudksrK7S9vXmkfgv8eQ==
|
integrity sha512-l/tf4ouBw7vLmqYdyV7MvdZKROr3Cc1+7qdVF2ejqeluZ5vDxomrFH/0ftOe7c1RdJdSSxdkuZikf5QGfjqFiw==
|
||||||
dependencies:
|
dependencies:
|
||||||
bluebird "3.7.2"
|
bluebird "3.7.2"
|
||||||
ghost-ignition "4.1.0"
|
ghost-ignition "4.1.0"
|
||||||
|
|
Loading…
Add table
Reference in a new issue