Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadMigrations ¶
LoadMigrations loads the raw migration SQL files from the given dir
Types ¶
type MigrationOptions ¶
type MigrationOptions struct {
Name string
}
MigrationOptions are used by methods on Migrator implementors to change behavior of those functions
type Migrator ¶
Migrator represents an object which when given a sql.DB can discover and run the appropriate migrations for that database. Additionally the New method should generate the next logical migration file wherever this migration expects to find them.
type SQLMigrator ¶
type SQLMigrator struct{}
SQLMigrator implements Migrator for a SQL database
func (SQLMigrator) Migrate ¶
func (sm SQLMigrator) Migrate(db *sqlx.DB) error
Migrate will run all necessary migrations on the given DB connection
func (SQLMigrator) New ¶
func (sm SQLMigrator) New(opts MigrationOptions) (string, error)
New creates a SQLMigrator with the given MigrationOptions
Click to show internal directories.
Click to hide internal directories.