use dbx.SQLOFunc instead of sql.DB
This commit is contained in:
@@ -2,7 +2,6 @@ package migrate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
"time"
|
||||
@@ -14,8 +13,8 @@ import (
|
||||
|
||||
// MigrationsOpts define the options for the migrations module.
|
||||
type MigrationOpts struct {
|
||||
// SQLO is the SQL database handle used for migrations. REQUIRED.
|
||||
SQLO *sql.DB
|
||||
// SQLO is the SQL database handle getter used for migrations. REQUIRED.
|
||||
SQLO dbx.SQLOFunc
|
||||
|
||||
// Dialect is the database dialect used for migrations (e.g., "mysql", "postgres").
|
||||
// REQUIRED. Must match the dialect used in dbx.
|
||||
@@ -138,7 +137,7 @@ func setupMigrations(_ *app.Module) error {
|
||||
}
|
||||
|
||||
// Initialize the goose migration provider
|
||||
Migration, err = goose.NewProvider(migrationsConfig.Dialect, migrationsConfig.SQLO, migrationsConfig.FS)
|
||||
Migration, err = goose.NewProvider(migrationsConfig.Dialect, migrationsConfig.SQLO(), migrationsConfig.FS)
|
||||
if err != nil {
|
||||
slog.Error("Couldn't initialize goose migration provider", "err", err)
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user