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

This commit is contained in:
Dawid Wysokiński 2022-11-27 09:38:13 +01:00
parent c5547f5d42
commit a2a2d53f25
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)