Skip to content

Commit

Permalink
Fix CockroachDb test, lock table should be created before versionTable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Jørgensen (LUJOR) committed Feb 19, 2019
1 parent 9d8ef5e commit 45d3ba3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions database/cockroachdb/cockroachdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ func WithInstance(instance *sql.DB, config *Config) (database.Driver, error) {
config: config,
}

if err := px.ensureVersionTable(); err != nil {
// ensureVersionTable is a locking operation, so we need to ensureLockTable before we ensureVersionTable.
if err := px.ensureLockTable(); err != nil {
return nil, err
}

if err := px.ensureLockTable(); err != nil {
if err := px.ensureVersionTable(); err != nil {
return nil, err
}

Expand Down

0 comments on commit 45d3ba3

Please sign in to comment.