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 with --write-sql does not respect tables that are not created in database #806

Closed
raph1mm opened this issue Apr 1, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@raph1mm
Copy link

raph1mm commented Apr 1, 2019

Bug Report

Q A
BC Break no
Version 2.0.0

Summary

In case when there are two migrations, which first creates table and the second one - changes it - using --dry-run crashes migrations.

Current behavior

Migrations cannot "see" tables that are created only "virtually" during dry run. There is error:

There is no table with name 'my_db.my_table' in the schema.

How to reproduce

  1. Create first migration with up() method:
    $schema->createTable('my_table');
  2. Create second migration with up() method:
    $schema->getTable('my_table');
  3. Run
    bin/console doctrine:migrations:migrate --write-sql='./my.sql'

Expected behavior

The expected behavior would be sql script with dumped all migrations - without any errors.

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

No branches or pull requests

2 participants