Pull requests

#5 Merged
Repository
ghthor
Branch
primary-key-bug
Repository
liamstask
Branch
master

Fixed - timestamp Primary key

Author
  1. Wilhelmina Drengwitz
Reviewers
Description

Issue

I ran into this issue when I created a blank database and a single migration file. goose would create the goose_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

  • Learn about pull requests

Comments (2)

  1. Liam Staskawicz repo owner

    Ah, yeah, that makes sense - thanks for catching this. I'll think about this a bit more when I have more time, but this seems like a reasonable solution at first glance.

    With regard to testing, I would love to add more coverage. I'll take a look at gospec - I've been pretty happy with the testing pkg so far, but could be open to other options.

    This would most definitely make it easier to get multiple DB platform support in place, as well.