Add better error messages when running migrations
continuous-integration/drone/pr Build is failing
Details
continuous-integration/drone/pr Build is failing
Details
This commit is contained in:
parent
0bbe6b93b5
commit
11df4b85e8
|
@ -673,17 +673,17 @@ create unique index UQE_users_namespace_id
|
|||
|
||||
sess := tx.NewSession()
|
||||
if err := sess.Begin(); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("unable to open session: %s", err)
|
||||
}
|
||||
for _, s := range sql {
|
||||
_, err := sess.Exec(s)
|
||||
if err != nil {
|
||||
_ = sess.Rollback()
|
||||
return err
|
||||
return fmt.Errorf("error executing update data for table %s, column %s: %s", table, column, err)
|
||||
}
|
||||
}
|
||||
if err := sess.Commit(); err != nil {
|
||||
return err
|
||||
return fmt.Errorf("error commiting data change: %s", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue