Merge pull request #248 from biefy/master

Solve lock contention problem when upgrading multiple logical MySQL databases backed by a single physical database.
This commit is contained in:
Matthias Kadenbach 2017-06-09 17:08:54 -07:00 committed by GitHub
commit d8dd1bc427
1 changed files with 4 additions and 2 deletions

View File

@ -156,7 +156,8 @@ func (m *Mysql) Lock() error {
return database.ErrLocked
}
aid, err := database.GenerateAdvisoryLockId(m.config.DatabaseName)
aid, err := database.GenerateAdvisoryLockId(
fmt.Sprintf("%s:%s", m.config.DatabaseName, m.config.MigrationsTable))
if err != nil {
return err
}
@ -180,7 +181,8 @@ func (m *Mysql) Unlock() error {
return nil
}
aid, err := database.GenerateAdvisoryLockId(m.config.DatabaseName)
aid, err := database.GenerateAdvisoryLockId(
fmt.Sprintf("%s:%s", m.config.DatabaseName, m.config.MigrationsTable))
if err != nil {
return err
}