Fix db migration error check
This commit is contained in:
parent
72f4783e34
commit
c1fe8c3c0d
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue