exec

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectProjectDB

func ConnectProjectDB(reconnect bool) (result bool, err error)

ConnectProjectDB Setup the Database connection to the project database. If the reconnect parameter is true, then a reconnect will be forced. This is used when recreating the project database.

func Exec

func Exec(options Options) (err error)

Exec Apply the migration to the project database. The parmeters can be used to just execute a dryrun, force past any validity checks, or disable using pt-online-schema-change.

func ExecuteSQL

func ExecuteSQL(statement string, dryrun bool) (output string, err error)

ExecuteSQL Execute SQL in the Project DB

func InProgressID

func InProgressID() (inProgressID int64, err error)

InProgressID Returns the ID of a migration in the DB whose current status is InProgress. If no Migration is running 0 is returned.

func SetProjectDB

func SetProjectDB(pdb *gorp.DbMap)

SetProjectDB Used to set a configured gorp.DbMap so that Unit Tests can control project database access

func Setup

func Setup(db *gorp.DbMap, projectDatabaseID int, projectConnDetails string)

Setup Setup the migration tables in the management DB

Types

type Options

type Options struct {
	MID              int64
	Dryrun           bool
	ForceCI          bool
	Rollback         bool
	PTODisabled      bool
	AllowDestructive bool
	Migration        *migration.Migration
	Sandbox          bool
	StepConfirm      bool
}

Options A helper struct for parameters when executing a Migration

Jump to

Keyboard shortcuts

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