From 28b89a977f8cce90b2e77c704d87aad2d6a97242 Mon Sep 17 00:00:00 2001 From: Elijah Duffy Date: Thu, 5 Jun 2025 15:05:57 -0700 Subject: [PATCH] make FS optional and actually call goose.SetBaseFS --- migrate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migrate.go b/migrate.go index 3c982f2..6fd5c08 100644 --- a/migrate.go +++ b/migrate.go @@ -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 {