Documentation ¶
Index ¶
Constants ¶
View Source
const ( SANDBOX = iota DEV STAGE MLT LT PROD )
Database Environments
Variables ¶
View Source
var EnvNames = []string{
"SANDBOX",
"DEV",
"STAGE",
"MLT",
"LT",
"PROD",
}
EnvNames Database Environment Names for debugging purposes
Functions ¶
func CreateTables ¶
CreateTables Create the Database table
Types ¶
type TargetDatabase ¶
type TargetDatabase struct { DBID int `db:"dbid, autoincrement, primarykey" json:"dbid"` Project string `db:"project" json:"project"` Name string `db:"name" json:"name"` Env string `db:"env" json:"env"` }
TargetDatabase TargetDatabase stores a list of target databases which allow for a single management database to store migrations, metedata, and steps for multiple target databases
func GetbyProject ¶
func GetbyProject(project string, name string, env string) (db TargetDatabase, err error)
GetbyProject Get a target database from the management db using the names of the project, database, and environment
func Load ¶
func Load(dbid int64) (db *TargetDatabase, err error)
Load Load a migation from the DB using the Migration ID primary key
func (*TargetDatabase) Insert ¶
func (d *TargetDatabase) Insert() error
Insert Insert the Database into the Management DB
Click to show internal directories.
Click to hide internal directories.