make FS optional and actually call goose.SetBaseFS

This commit is contained in:
Elijah Duffy
2025-06-05 15:05:57 -07:00
parent c21042edb8
commit 28b89a977f

View File

@@ -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 {