feat: add data fix framework

This commit is contained in:
2026-05-26 13:48:09 +02:00
parent f5dfb91ffe
commit 36213edd60
3 changed files with 116 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ var Module = fx.Options(
ProvideSQLDB,
ProvideQueries,
),
fx.Invoke(RunMigrations),
fx.Invoke(RunMigrationsAndFixes),
)
func ProvideSQLDB() (*sql.DB, error) {
@@ -49,3 +49,9 @@ func RunMigrations(sqlDB *sql.DB) error {
return nil
}
func RunMigrationsAndFixes(sqlDB *sql.DB) error {
if err := RunMigrations(sqlDB); err != nil {
return err
}
return RunDataFixes(sqlDB)
}