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

Always update migrated versions #1094

Open
wants to merge 1 commit into
base: 3.0.x
Choose a base branch
from

Conversation

kick-the-bucket
Copy link

@kick-the-bucket kick-the-bucket commented Nov 30, 2020

Q A
Type improvement
BC Break no
Fixed issues

Summary

When migrating from v2 to v3 in a big project (with different migration classes in different branches) metadata sync becomes very cumbersome when you already have executed migrations from other branches than you are currently on, since the version names are only migrates once along with the table structure. At the moment the workaround we use is dropping the execution_time column before running doctrine:migrations:migrate, to ensure the names are always updated when you're in a branch with already executed, but not yet synced version names.

This change will make the names always update, no matter if there are structural changes to the table needed or not.

If this is not preferred - I could add a new flag to enable this behavior only when needed.

@goetas
Copy link
Member

goetas commented Dec 2, 2020

Hmm... I find this very risky (even if probably it will help local development...).

I do not understand in which situations version names are not in sync? from my understanding, this happens only for a short period while migrating from 2.x to 3.x, isnt?

@kick-the-bucket
Copy link
Author

Situation:

  1. you write a migration version 1 in a branch A and execute it
  2. you update from migrations v2 to v3 in branch B.
  3. you merge branch B into main/master, execute migrations, your metadata table structure is updated on first run, but since the already executed version 1 is not in your code at this moment (it's in a different branch) - the name does not get updated and it never will be, unless you do it manually.

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

Successfully merging this pull request may close these issues.

2 participants