fix: unify goose Provider path and fail on pending migrations
Apply BasePath via fs.Sub, route CLI through Provider API, return ErrPendingMigrations when auto-migrate is disabled, use DownTo for blank. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// Package migrate integrates pressly/goose with go-toolkit [app.Module] lifecycles.
|
||||
//
|
||||
// # Setup
|
||||
//
|
||||
// Embed migration SQL, configure [MigrationOpts] with SQLO, Dialect, FS, and optional
|
||||
// BasePath, then register [ModuleMigrations] before dependent modules such as
|
||||
// [ModuleAutoMigrate] or CLI commands via [gitea.auvem.com/go-toolkit/migrate/cli].
|
||||
//
|
||||
// # BasePath
|
||||
//
|
||||
// When BasePath is not ".", migration files are read from fs.Sub(FS, BasePath) for
|
||||
// the goose Provider. Keep CLI create paths aligned with BasePath.
|
||||
//
|
||||
// # Zero version
|
||||
//
|
||||
// Goose requires a version-0 migration when bootstrapping a fresh database.
|
||||
package migrate
|
||||
Reference in New Issue
Block a user