Skip to content

DB Migration script 6.24.0 -> 6.25.1 error dropping nullable automated_emails.email_design_setting_id #27110

@KevinVR

Description

@KevinVR

Issue Summary

Related to #27062. Upgrading from 6.24.0 to 6.25.1 gives database migration errors

All the migration scripts run fine, except the last one 6.25/2026-03-31-20-31-19-drop-nullable-on-automated-emails-email-design-setting-id.js

This results in

...
Backfilling automated_emails.email_design_setting_id
Dropping nullable: automated_emails.email_design_setting_id
Rolling back: alter table `automated_emails` modify `email_design_setting_id` varchar(24) not null - Cannot change column 'email_design_setting_id': used in a foreign key constraint 'automated_emails_email_design_setting_id_foreign'.

It looks like db script 6.25/2026-03-30-22-16-43-add-email-design-setting-id-to-automated-emails.js creates this new FK. But then in 6.25/2026-03-31-20-31-19-drop-nullable-on-automated-emails-email-design-setting-id.js it's not allowed to modify the column due to this FK being present.

This automated_emails.email_design_setting_id column did not exist in 6.24.

Steps to Reproduce

Existing Ghost blog with 6.24.0 version
Upgrade to 6.25.1

MySQL version 8.4

Ghost Version

6.24.0

Node.js Version

Node.JS version From Ghost Docker image

How did you install Ghost?

Ghost Docker image

Database type

MySQL 8

Browser & OS version

No response

Relevant log / error output

Backfilling automated_emails.email_design_setting_id
Dropping nullable: automated_emails.email_design_setting_id
Rolling back: alter table `automated_emails` modify `email_design_setting_id` varchar(24) not null - Cannot change column 'email_design_setting_id': used in a foreign key constraint 'automated_emails_email_design_setting_id_foreign'.

Code of Conduct

  • I agree to be friendly and polite to people in this repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs:triage[triage] this needs to be triaged by the Ghost team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions