Fix db migration error check

This commit is contained in:
Chen-I Lim 2020-10-22 08:41:47 -07:00
parent 72f4783e34
commit c1fe8c3c0d
2 changed files with 3 additions and 3 deletions

View file

@ -46,7 +46,7 @@ func (s *SQLStore) Migrate() error {
}
err = m.Up()
if err != nil && errors.Is(err, migrate.ErrNoChange) {
if err != nil && !errors.Is(err, migrate.ErrNoChange) {
return err
}

View file

@ -27,7 +27,7 @@ func New(dbType, connectionString string) (*SQLStore, error) {
err = db.Ping()
if err != nil {
log.Println(`Database Ping failed`)
log.Printf(`Database Ping failed: %v`, err)
return nil, err
}
@ -39,7 +39,7 @@ func New(dbType, connectionString string) (*SQLStore, error) {
err = store.Migrate()
if err != nil {
log.Println(`Table creation failed`)
log.Printf(`Table creation / migration failed: %v`, err)
return nil, err
}