make FS optional and actually call goose.SetBaseFS
This commit is contained in:
@@ -95,9 +95,6 @@ func ModuleMigrations(cfg MigrationOpts) *app.Module {
|
||||
if cfg.BasePath == "" {
|
||||
cfg.BasePath = "." // default base path if not set
|
||||
}
|
||||
if cfg.FS == nil {
|
||||
panic("Migration filesystem (FS) must be set in the configuration")
|
||||
}
|
||||
|
||||
migrationsConfig = cfg // store configuration at package level
|
||||
|
||||
@@ -136,6 +133,9 @@ func setupMigrations(_ *app.Module) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set base filesystem for goose migrations
|
||||
goose.SetBaseFS(migrationsConfig.FS)
|
||||
|
||||
// Initialize the goose migration provider
|
||||
Migration, err = goose.NewProvider(migrationsConfig.Dialect, migrationsConfig.SQLO(), migrationsConfig.FS)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user