migrations
migrations copied to clipboard
Migrator should re-create the schema when the migration date is older than the last file modification
This is a (multiple allowed):
- [] bug
- [x] enhancement
- [x] 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.
Seems like a good improvement to me.
This should help with branch switching.
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.
@pabloelcolombiano Were you planning on writing this or just a request?
@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.