Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MigrationTableMigration = Migration{ Name: "create_migration_table", Up: []string{createMigrationTable}, Down: []string{dropMigrationTable}, }
MigrationTableMigration set's up the needed migration table to track migrations This needs to be the first Migration added to your migrations list.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct { Name string Up []string Down []string // contains filtered or unexported fields }
Migration contains3 needed parts: Name: unique to the migration, identifies the migration in the database Up: Serie of SQL statements to run to apply the migration Down: Series of SQL statement to reverse the migration
type Migrations ¶
type Migrations []Migration
Migrations holds the migrations in order
func (*Migrations) Add ¶
func (m *Migrations) Add(mig Migration) *Migrations
Add a migration to the queue
Click to show internal directories.
Click to hide internal directories.