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

Migrator should re-create the schema when the migration date is older than the last file modification #528

Open
2 tasks done
pabloelcolombiano opened this issue Dec 9, 2021 · 5 comments

Comments

@pabloelcolombiano
Copy link
Contributor

This is a (multiple allowed):

  • [] bug
  • enhancement
  • feature-discussion (RFC)

This is an improvement suggestion for the MIgrator.

The migrator recreates the schema when the migrations have changed. For example: a new migration was added.

However while developing, it can happen that a migration has not been added, but modified (a field renamed, or added, etc). In this case also it is required to recreate the schema, which has to be doen manually.

The proposal would be not to look for new migrations only, but also check that the date of modification of the migration files are older than the date where the respective migration was run.

PR coming if interest arises.

@markstory markstory added this to the 3.x (CakePHP 4) milestone Dec 9, 2021
@markstory
Copy link
Member

Seems like a good improvement to me.

@othercorey
Copy link
Member

This should help with branch switching.

@pabloelcolombiano
Copy link
Contributor Author

Branch switching is already handled by the Migrator. This would rather cover the case where you are on the same branch, but modifying your migration files.

@othercorey
Copy link
Member

@pabloelcolombiano Were you planning on writing this or just a request?

@pabloelcolombiano
Copy link
Contributor Author

@othercorey the plan was to implement it, but could not find time for the moment, and will not in the coming 2 weeks.
It is a very minor improvement, though.

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

3 participants