Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Migration ¶
Migration is the top-level migration instance.
func NewMigration ¶
func NewMigration( logger *logrus.Logger, repository *Repository, versionsDir string, verbose bool, ) *Migration
NewMigration creates an instance of Migration.
func (*Migration) FindMigrations ¶
func (m *Migration) FindMigrations() (*PlannedMigration, error)
FindMigrations determine planned migrations.
type PlannedMigration ¶
type PlannedMigration struct {
Tasks []*Task
}
PlannedMigration migrations to be run.
type Repository ¶
Repository contains the DB controller of the Version table.
func NewRepository ¶
func NewRepository( db *gorm.DB, ) *Repository
NewRepository creates an instance of Repository.
func (*Repository) Delete ¶
func (r *Repository) Delete(name string) error
Delete remove the given `Migration.Name` from the database,
func (*Repository) Find ¶
func (r *Repository) Find() ([]*Version, error)
Find return all records from the database,
func (*Repository) FindByName ¶
func (r *Repository) FindByName(name string) (*Version, error)
FindByName find the given `Migration.Name` from the database,
func (*Repository) First ¶
func (r *Repository) First() (*Version, error)
First find the first `Migration` record from the database,
func (*Repository) Insert ¶
func (r *Repository) Insert(name string) error
Insert add a new `Migration` record into the database,
func (*Repository) Last ¶
func (r *Repository) Last() (*Version, error)
Last find the last `Migration` record from the database,
Click to show internal directories.
Click to hide internal directories.