Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunMigrations ¶
func RunMigrations( d types.Querier, migrations []*Migration, typ MigrationType, to string, logger *slog.Logger, ) error
RunMigrations applies or rolls back migrations. to can either be a migration name, or "all".
Types ¶
type Migration ¶
type Migration struct { ID int64 Name string Applied bool History []MigrationEvent Up sql.Null[string] Down sql.Null[string] }
Migration is a database migration.
type MigrationEvent ¶
type MigrationEvent struct { Type MigrationType Time time.Time }
MigrationEvent is a record of a migration being applied or rolled back.
type MigrationType ¶
type MigrationType string
MigrationType is the type of the migration.
const ( MigrationUp MigrationType = "up" MigrationDown MigrationType = "down" )
Migration types.
Click to show internal directories.
Click to hide internal directories.