Documentation
¶
Index ¶
Constants ¶
View Source
const MigrationSQLFilePattern = `^(\d{14})_([\-_a-z0-9]+)?\.(up|down)\.(sql)$`
Variables ¶
This section is empty.
Functions ¶
func LoadMigrations ¶
func LoadMigrations(folder string) ([]SQLMigration, []SQLMigration, error)
Types ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func NewMigrator(db *sql.DB, upMigrations, downMigrations []SQLMigration) Migrator
func (Migrator) MigrateDown ¶
type SQLMigration ¶
type SQLMigration struct {
// contains filtered or unexported fields
}
func NewSQLMigration ¶
func (SQLMigration) CheckValid ¶
func (m SQLMigration) CheckValid() error
func (SQLMigration) Less ¶
func (m SQLMigration) Less(m2 SQLMigration) bool
Click to show internal directories.
Click to hide internal directories.