mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
Updated migration to always set a value
- When both parameters passed to `update` resolve to `undefined` we throw an `Empty .update() call detected` error - This change always updates the `sender_email` to null rather than skipping the field - `sender_reply_to` should still be `undefined` so we don't override an existing non-null value
This commit is contained in:
parent
bc464f8930
commit
8e1c10d146
@ -22,7 +22,7 @@ module.exports = createTransactionalMigration(
|
||||
await knex('newsletters')
|
||||
.update({
|
||||
// CASE: members_from_address is 'noreply' - we leave it as null to maintain fallback behaviour
|
||||
sender_email: !fromAddress || fromAddress.value === 'noreply' ? undefined : fromAddress.value,
|
||||
sender_email: !fromAddress || fromAddress.value === 'noreply' ? null : fromAddress.value,
|
||||
sender_reply_to: replyTo ? replyTo.value : undefined
|
||||
})
|
||||
.whereNull('sender_email')
|
||||
|
Loading…
Reference in New Issue
Block a user