Documentation
¶
Overview ¶
Package migrate is a small SQLite migration runner shared across hive's databases. It applies embedded, versioned up SQL migrations (NNNN_name.up.sql) tracked in a schema_migrations table, one transaction per migration.
It is deliberately storage-agnostic: callers pass an fs.FS rooted at their migration files (e.g. fs.Sub(embedFS, "migrations")), so each database owns its own migration set while sharing this runner. Any bootstrapping specific to a database (such as seeding from a legacy version table) is the caller's responsibility: load the migrations, EnsureTable, do the bootstrap, then Apply.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppliedVersions ¶
AppliedVersions returns the set of already-applied migration versions.
func Apply ¶
Apply ensures the tracking table exists, then applies every migration not already recorded, in ascending version order, one transaction each.
func EnsureTable ¶
EnsureTable creates the schema_migrations tracking table if it does not exist.