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

Only mark migrations as installed after execution #25924

Conversation

nickvergessen
Copy link
Member

The problem is that if a developer creates a structural error in their migration file,
they will already be marked as executed and an not be rerun.

Happened to @Rello in the analytics app.

The problem is that if a developer creates a structural error in their migration file,
they will already be marked as executed and an not be rerun.

Signed-off-by: Joas Schilling <coding@schilljs.com>
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this cause problems if part of it has been applied?

@nickvergessen
Copy link
Member Author

nickvergessen commented Mar 5, 2021

Well currently all are marked as executed even if nothing is executed...

This basically boils down to the "code safe for your step and depend on others", e.g.

@Rello
Copy link
Contributor

Rello commented Mar 5, 2021

I could add the current case:
in an old migration file, I was using Type-Constants. they were removed with the doctrine update in NC21.
So any new app installation under NC21 failed.
But as the migration file was marked as processed, there was no chance of recovery than asking the user to manually delete a record in the database.

A fix to the migration file was released, but it was not possible to re-execute it

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

@MorrisJobke MorrisJobke merged commit 459e0b3 into master Mar 17, 2021
@MorrisJobke MorrisJobke deleted the bugfix/noid/only-mark-migrations-as-installed-after-executing-them-in-case-the-developer-broke-them branch March 17, 2021 19:29
@MorrisJobke
Copy link
Member

@nickvergessen Do we want to backport this?

@nickvergessen
Copy link
Member Author

/backport to stable21

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

Successfully merging this pull request may close these issues.

4 participants