migrator

package
v1.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migration

type Migration struct {
	ID        int       `db:"id"`
	Name      string    `db:"name"`
	Batch     int       `db:"batch"`
	CreatedAt time.Time `db:"created_at"`
}

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

func NewMigrator

func NewMigrator(db *sqlx.DB, driver string) *Migrator

func (*Migrator) AddMigrationRaw

func (m *Migrator) AddMigrationRaw(migration string)

func (*Migrator) CreateMigrationsTable

func (m *Migrator) CreateMigrationsTable() bool

func (*Migrator) GetExtraMigrations

func (m *Migrator) GetExtraMigrations(names []string) []Migration

func (*Migrator) GetLastBatch

func (m *Migrator) GetLastBatch() int

func (*Migrator) GetLastMigration

func (m *Migrator) GetLastMigration() (bool, *Migration)

func (*Migrator) GetLastMigrations

func (m *Migrator) GetLastMigrations() []*Migration

func (*Migrator) MigrationExist

func (m *Migrator) MigrationExist(name string) bool

func (*Migrator) RemoveLastBatch

func (m *Migrator) RemoveLastBatch()

func (*Migrator) RemoveMigrationRaw

func (m *Migrator) RemoveMigrationRaw(migration string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL