Fixed - timestamp Primary key
Will Drengwitz
Branch: ghthor/goose:primary-key-bug
Branch: liamstask/goose:master
Merged
Merged pull request
Breaking change: Merged in ghthor/goose/primary-key-bug (pull request #5: Fixed - timestamp Primary key)
Breaking change: Merged in ghthor/goose/primary-key-bug (pull request #5: Fixed - timestamp Primary key)
Issue
I ran into this issue when I created a blank database and a single migration file.
goose
would create thegoose_db_version
table and insert a version statement. Then it would apply the migration. The initial version statement and the completed migration statement had the same time-stamp and MySQL complains about non-unique Primary key.Fix
Fixed this by creating an
id
column that is auto incremented so it is guaranteed to be unique for each version statement.Testing
Have you any plans to cover this project in tests? I'd be interested in helping out. I've used gospec pretty extensively and would recommend it's use.
I didn't get a chance to test this with pg backend. Would be nice to begin adding some automated integration tests.
Cheers, I'm pretty excited about goose