Skip to content

Support timestamp 'versions' by falling back to string comparison when to VersionInts() are equal#25

Merged
rubenv merged 4 commits intorubenv:masterfrom
larsmoa:master
Jun 14, 2016
Merged

Support timestamp 'versions' by falling back to string comparison when to VersionInts() are equal#25
rubenv merged 4 commits intorubenv:masterfrom
larsmoa:master

Conversation

@larsmoa
Copy link
Copy Markdown

@larsmoa larsmoa commented Mar 1, 2016

Currently, the two following migrations are considered to have the same version:

20160126_1100_migration1.sql
20160126_1200_migration2.sql

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.

@rubenv rubenv merged commit 1911909 into rubenv:master Jun 14, 2016
@rubenv
Copy link
Copy Markdown
Owner

rubenv commented Jun 14, 2016

Cool, thanks!

Sorry for taking this long to merge.

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

Successfully merging this pull request may close these issues.

2 participants