Documentation ¶
Index ¶
Constants ¶
const ( MigrationsColRecordID = "record_id" MigrationsColCreatedAt = "created_at" MigrationsColName = "name" MigrationsColStatus = "status" MigrationsTableName = "migrations" // MigrationNotRun - Defines the constant for the state of a migration that has not yet been performed MigrationNotRun = 0 // MigrationSuccess - Defines the constant for the state of a successful migration MigrationSuccess = 1 // MigrationFailed - Defines the constant for the state of a migration that has been performed but has failed MigrationFailed = 2 )
Constants related to the migrations table
Variables ¶
This section is empty.
Functions ¶
func LoadMigrationByName ¶
LoadMigrationByName - It takes care of loading the instance of a record of the migrations table given the name
Types ¶
type Migration ¶
type Migration struct { RecordID int64 `db:"record_id"` CreatedAt time.Time `db:"created_at"` Name string `db:"name"` Status int `db:"status"` // contains filtered or unexported fields }
Migration - Struct that defines the migrations table, implements TableRecordInterface
func InsertNewMigration ¶
InsertNewMigration - It takes care of inserting a record in the migrations table
func LoadAllMigrations ¶
func LoadAllMigrations(db db.SQLConnector) ([]*Migration, error)
LoadAllMigrations - Load all instances of Migration from the database
func NewMigration ¶
func NewMigration(db db.SQLConnector) *Migration
NewMigration - It takes care of instantiating a new Migration object by instantiating its TableRecord and setting it as "new" We recommend that you always use this method to create a new Migration instance
func (Migration) GetPrimaryKeyName ¶
GetPrimaryKeyName - Returns the primary key name
func (Migration) GetPrimaryKeyValue ¶ added in v1.3.1
GetPrimaryKeyValue - Returns the primary key value
func (Migration) GetTableName ¶
GetTableName - Returns the table name
func (Migration) GetTableRecord ¶
func (m Migration) GetTableRecord() *record.TableRecord
GetTableRecord - Returns the instance of TableRecord