fixed the SetupMigrator
Dieser Commit ist enthalten in:
Ursprung
8d9b870820
Commit
2326ceb32e
|
@ -188,7 +188,7 @@ func SetupMigrator(prefix string, connection *pgx.Conn, migrations fs.FS) (mig *
|
||||||
mig, err = migrate.NewMigratorEx(
|
mig, err = migrate.NewMigratorEx(
|
||||||
context.TODO(),
|
context.TODO(),
|
||||||
connection,
|
connection,
|
||||||
"version",
|
prefix+"version",
|
||||||
&migrate.MigratorOptions{
|
&migrate.MigratorOptions{
|
||||||
DisableTx: false,
|
DisableTx: false,
|
||||||
},
|
},
|
||||||
|
@ -197,12 +197,13 @@ func SetupMigrator(prefix string, connection *pgx.Conn, migrations fs.FS) (mig *
|
||||||
log.Error().Err(err).Msg("Error while creating the migrator")
|
log.Error().Err(err).Msg("Error while creating the migrator")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
mig.OnStart = logmigrations
|
||||||
|
mig.Data["prefix"] = prefix
|
||||||
err = mig.LoadMigrations(migrations)
|
err = mig.LoadMigrations(migrations)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Error while loading migrations")
|
log.Error().Err(err).Msg("Error while loading migrations")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mig.OnStart = logmigrations
|
log.Trace().Interface("migrations", mig.Migrations).Interface("data", mig.Data).Err(err).Send()
|
||||||
mig.Data["prefix"] = prefix
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Laden…
In neuem Issue referenzieren