Documentation ¶
Index ¶
- func Migrate(db *sqlx.DB, migrations MigrationsT, name string) ([]string, error)
- func MigrationCommand(db *sqlx.DB, root string) *cobra.Command
- func Rollback(db *sqlx.DB, migrations MigrationsT, name string) ([]string, error)
- func Script(db *sqlx.DB, migrations MigrationsT, name string) ([]string, error)
- func Seed(db *sqlx.DB, migrations MigrationsT, name string) ([]string, error)
- type MigrationT
- type MigrationsT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Migrate ¶
Migrate run migration up on database
pass migration name to run migrate on specific migration
func MigrationCommand ¶
MigrationCommand get migration command
func Rollback ¶
Rollback run migration down on database
pass migration name to run rollback on specific migration
Types ¶
type MigrationT ¶
func (MigrationT) In ¶
func (m MigrationT) In(skips ...string) bool
type MigrationsT ¶
type MigrationsT []MigrationT
func ReadDirectory ¶
func ReadDirectory(dir string) (MigrationsT, error)
ReadDirectory read migration from file system
func (MigrationsT) Filter ¶
func (m MigrationsT) Filter(name string) MigrationsT
Filter filter migrations by name
func (MigrationsT) Len ¶
func (m MigrationsT) Len() int
func (MigrationsT) Less ¶
func (m MigrationsT) Less(i, j int) bool
func (MigrationsT) Reverse ¶ added in v2.0.3
func (m MigrationsT) Reverse()
Reverse reverse array order
func (MigrationsT) Swap ¶
func (m MigrationsT) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.