database

package
v0.0.0-...-f64704c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2017 License: MIT Imports: 4 Imported by: 0

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

func CreateTables() (result bool, err error)

CreateTables Create the Database table

func Setup

func Setup(db *gorp.DbMap)

Setup Setup the Database table in the management DB

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL