Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMySQLClient ¶ added in v1.1.0
CreateMySQLClient Create a new MySQL Client, so we can make a connection to a database.
func MigrateDB ¶
func MigrateDB(db *sql.DB, data []DBMigrationData)
MigrateDB Given a connection string and an array of `MigrationData` scripts, will attempt to run the migrations against your database. If this is the first time you use this tool, it will auto create a `migrations` table on the database first. Migrations are stored in that table, and you can go query the database directly to check the status of a particular migration.
Types ¶
type DBMigrationData ¶
DBMigrationData represents the name of a migration file and the SQL we need to run.
type DBMigrationEvent ¶
type DBMigrationEvent struct {
ID int `json:"id"`
Name string `json:"name"`
File string `json:"file"`
Created string `json:"created"`
}
DBMigrationEvent represents a migration event that has happened that we will store in the database, so we can check on the next deployment if we need to run migrations.