Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations schema dump result SQL has incorrect order #1493

Open
Bart-Westenenk opened this issue Mar 4, 2025 · 0 comments
Open

Migrations schema dump result SQL has incorrect order #1493

Bart-Westenenk opened this issue Mar 4, 2025 · 0 comments

Comments

@Bart-Westenenk
Copy link

Bug Report

Q A
BC Break no
Version 3.4.1

Summary

Foreign key constraints depend on both tables and columns existing. The schema dump command first creates the table, then adds the foreign keys while the foreign table does not exist yet.

Current behavior

doctrine:migrations:schema-dump dumps the schema table per table.

How to reproduce

Have a relatively simple schema with 2 entities that depend on eachother using associations (and thus foreign key constraints)

Run the following commands, and see that the last command fails:

  • php bin/console doctrine:database create
  • php bin/console doctrine:database:update --force
  • php bin/console doctrine:migrations:schema-dump
  • php bin/console doctrine:database:drop --force
  • php bin/console doctrine:database:create
  • php bin/console doctrine:migrations:migrate -n

Expected behavior

I expect the last commad to complete and run the migration given by doctrine:migrations:schema-dump succesfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant