Documentation
¶
Index ¶
Constants ¶
View Source
const InitialSchemaName = "2026090101"
Bun stores the numeric migration name and derives "initial_schema" as its human-readable comment from the filename.
Variables ¶
View Source
var ErrIncompatibleDatabase = errors.New("database contains an incompatible SynapS3 schema")
View Source
var Migrations = func() *migrate.Migrations { registry, err := discoverMigrations(sqlMigrations) if err != nil { panic(err) } return registry }()
Migrations is the global registry of database migrations.
Functions ¶
func NewMigrator ¶
NewMigrator is the only supported migrator constructor. Migration markers are written only after the corresponding body succeeds.
func ValidateTarget ¶
ValidateTarget refuses, before anything is written, a database that is not this application's: its recorded migrations must be an ordered prefix of the registry. Without a recorded migration, only an empty target or a complete baseline with initialized migration metadata is accepted. Whether migrations build the intended schema is verified by tests, not here.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.