migrations: bump morph dependency and reflect changes (#21670)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
06ad69a406
Коммит
1edbf67bb2
@@ -1034,18 +1034,10 @@ func (ss *SqlStore) migrate(direction migrationDirection) error {
|
||||
return err
|
||||
}
|
||||
db := setupConnection("master", dataSource, ss.settings)
|
||||
driver, err = ms.WithInstance(db, &ms.Config{
|
||||
Config: drivers.Config{
|
||||
StatementTimeoutInSecs: *ss.settings.MigrationsStatementTimeoutSeconds,
|
||||
},
|
||||
})
|
||||
driver, err = ms.WithInstance(db)
|
||||
defer db.Close()
|
||||
case model.DatabaseDriverPostgres:
|
||||
driver, err = ps.WithInstance(ss.GetMasterX().DB.DB, &ps.Config{
|
||||
Config: drivers.Config{
|
||||
StatementTimeoutInSecs: *ss.settings.MigrationsStatementTimeoutSeconds,
|
||||
},
|
||||
})
|
||||
driver, err = ps.WithInstance(ss.GetMasterX().DB.DB)
|
||||
default:
|
||||
err = fmt.Errorf("unsupported database type %s for migration", ss.DriverName())
|
||||
}
|
||||
@@ -1056,6 +1048,7 @@ func (ss *SqlStore) migrate(direction migrationDirection) error {
|
||||
opts := []morph.EngineOption{
|
||||
morph.WithLogger(log.New(&morphWriter{}, "", log.Lshortfile)),
|
||||
morph.WithLock("mm-lock-key"),
|
||||
morph.SetStatementTimeoutInSeconds(*ss.settings.MigrationsStatementTimeoutSeconds),
|
||||
}
|
||||
engine, err := morph.New(context.Background(), driver, src, opts...)
|
||||
if err != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user