fix: migrations table is already locked
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Dawid Wysokiński 2022-11-27 09:37:07 +01:00
parent 026db8e50f
commit 5f144a9fd2
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892
1 changed files with 5 additions and 4 deletions

View File

@ -40,6 +40,11 @@ func newMigrateCmd() *cli.Command {
}()
migrator := migrations.NewMigrator(db)
if err = migrator.Init(c.Context); err != nil {
return fmt.Errorf("migrator.Init: %w", err)
}
if err = migrator.Lock(c.Context); err != nil {
return err
}
@ -47,10 +52,6 @@ func newMigrateCmd() *cli.Command {
_ = migrator.Unlock(c.Context)
}()
if err = migrator.Init(c.Context); err != nil {
return fmt.Errorf("migrator.Init: %w", err)
}
group, err := migrator.Migrate(c.Context)
if err != nil {
return fmt.Errorf("migrator.Migrate: %w", err)