Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MigrateResult ¶
MigrateResult summarises the outcome of a Migrate call.
func Migrate ¶
func Migrate(ctx context.Context, cfg *config.Config, fromVersion, toVersion string) (MigrateResult, error)
Migrate applies all pending claw schema migrations in order. fromVersion and toVersion constrain which migrations to run:
- fromVersion: skip migrations whose name is lexicographically <= fromVersion. An empty string means "start from the beginning".
- toVersion: stop after applying the migration whose name is <= toVersion. An empty string (default) means "apply everything available".
Progress is printed to stdout as each migration runs.
type MigrationEntry ¶
type MigrationEntry struct {
// Name is the base filename of the migration (e.g. "001_init.sql").
Name string
// Applied is true when the migration is recorded in np_claw.schema_versions.
Applied bool
}
MigrationEntry describes a single claw schema migration.
Click to show internal directories.
Click to hide internal directories.