Move license from MIT to Apache 2.0. Add Makefile

This commit is contained in:
Vikram Rangnekar
2019-11-28 01:25:46 -05:00
parent aff2a13ba4
commit 9ebd03fa8c
42 changed files with 885 additions and 210 deletions

View File

@ -244,7 +244,6 @@ func (m *Migrator) AppendMigration(name, upSQL, downSQL string) {
UpSQL: upSQL,
DownSQL: downSQL,
})
return
}
// Migrate runs pending migrations
@ -315,7 +314,7 @@ func (m *Migrator) MigrateTo(targetVersion int32) (err error) {
if err != nil {
return err
}
defer tx.Rollback(ctx)
defer tx.Rollback(ctx) //nolint: errcheck
// Fire on start callback
if m.OnStart != nil {
@ -332,7 +331,9 @@ func (m *Migrator) MigrateTo(targetVersion int32) (err error) {
}
// Reset all database connection settings. Important to do before updating version as search_path may have been changed.
tx.Exec(ctx, "reset all")
if _, err := tx.Exec(ctx, "reset all"); err != nil {
return err
}
// Add one to the version
_, err = tx.Exec(ctx, "update "+m.versionTable+" set version=$1", sequence)