This happens because only the first number in the ID string is used for comparion, i.e. 20160126 for both migrations. The patch fixes this by falling back to string comparsion when Migration.VersionInt() returns the same version for two migrations.
Also, generalize temporary filename used for migration_test.go by using ioutil.TempFile() to create one.
Currently, the two following migrations are considered to have the same version:
This happens because only the first number in the ID string is used for comparion, i.e.
20160126
for both migrations. The patch fixes this by falling back to string comparsion whenMigration.VersionInt()
returns the same version for two migrations.Also, generalize temporary filename used for
migration_test.go
by usingioutil.TempFile()
to create one.