migrate icon indicating copy to clipboard operation
migrate copied to clipboard

Missing down migrations puts schema in bad state

Open anacrolix opened this issue 7 years ago • 5 comments

missing x.down for x.up files leaves values in the schema_migrations relation. Then migrate up and down incorrectly determine the current schema version.

anacrolix avatar Feb 15 '17 05:02 anacrolix

Are you using the postgres driver?

This has been fixed in v3 with full test coverage on all these scenarios. see https://github.com/mattes/migrate/blob/v3.0-prev/migrate_test.go#L17

I am going to release a release candidate in the next days. Would you mind testing again then?

mattes avatar Feb 15 '17 06:02 mattes

Yes I am. I will be happy to test.

anacrolix avatar Feb 15 '17 06:02 anacrolix

Cool! Thank you! Will keep this open and ping you here again. Just to confirm, postgres or which database were you using?

mattes avatar Feb 15 '17 07:02 mattes

$ postgres --version postgres (PostgreSQL) 9.6.1

anacrolix avatar Feb 15 '17 22:02 anacrolix

@anacrolix, I just pushed https://github.com/mattes/migrate/releases/tag/v3.0.0-rc0

Want to give it a try? Super interested in your feedback, too.

mattes avatar Feb 20 '17 00:02 mattes