Documentation
¶
Index ¶
Constants ¶
View Source
const ( MigratorDefault = "default" MigratorSql = "sql" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migrator ¶
type Migrator interface {
// Create a new migration file.
Create(name string) (string, error)
// Fresh the migrations.
Fresh() error
// Reset the migrations.
Reset() error
// Rollback the last migration operation.
Rollback(step, batch int) error
// Run the migrations according to paths.
Run() error
// Status get the migration's status.
Status() ([]Status, error)
}
type Repository ¶
type Repository interface {
// CreateRepository Create the migration repository data store.
CreateRepository() error
// Delete Remove a migration from the log.
Delete(migration string) error
// DeleteRepository Delete the migration repository data store.
DeleteRepository() error
// GetLast Get the last migration batch.
GetLast() ([]File, error)
// GetLastBatchNumber Get the last migration batch number.
GetLastBatchNumber() (int, error)
// GetMigrations Get the completed migrations.
GetMigrations() ([]File, error)
// GetMigrationsByBatch Get the list of the migrations by batch.
GetMigrationsByBatch(batch int) ([]File, error)
// GetMigrationsByStep Get the list of migrations.
GetMigrationsByStep(steps int) ([]File, error)
// GetNextBatchNumber Get the next migration batch number.
GetNextBatchNumber() (int, error)
// GetRan Get the completed migrations.
GetRan() ([]string, error)
// Log that a migration was run.
Log(file string, batch int) error
// RepositoryExists Determine if the migration repository exists.
RepositoryExists() bool
}
Click to show internal directories.
Click to hide internal directories.