gitschemalex

package module
v0.0.0-...-b690b7f Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2017 License: MIT Imports: 15 Imported by: 2

README

Build Status

git-schemalex

database migration tool for mysql schema is managed via git.

DOWNLOAD

$ go get github.com/schemalex/git-schemalex/cmd/git-schemalex

USAGE

$ git schemalex -schema path/to/schema -dsn "$root:$passowrd@/$database" -workspace /path/to/git/repository -deploy
DSN

see go-sql-driver/mysql

SEE ALSO

LICENSE

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEqualVersion = errors.New("db version is equal to schema version")
)

Functions

This section is empty.

Types

type Runner

type Runner struct {
	Workspace string
	Deploy    bool
	DSN       string
	Table     string
	Schema    string
}

func (*Runner) DB

func (r *Runner) DB() (*sql.DB, error)

func (*Runner) DatabaseVersion

func (r *Runner) DatabaseVersion(ctx context.Context, db *sql.DB, version *string) error

func (*Runner) DeploySchema

func (r *Runner) DeploySchema(ctx context.Context, db *sql.DB, version string) error

func (*Runner) Run

func (r *Runner) Run(ctx context.Context) error

func (*Runner) SchemaVersion

func (r *Runner) SchemaVersion(ctx context.Context) (string, error)

func (*Runner) UpgradeSchema

func (r *Runner) UpgradeSchema(ctx context.Context, db *sql.DB, schemaVersion string, dbVersion string) error

Directories

Path Synopsis
cmd
git-schemalex command

Jump to

Keyboard shortcuts

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