migrations

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migration

type Migration struct {
	Queries []Query
}

Migration defines a structure for holding metadata and queries to be ran against a database

type Migrations

type Migrations struct {
	IsSilent bool
}

Migrations is a config object to help pass in settings

func (Migrations) Create

func (m Migrations) Create(outputDir string, name string)

Create creates a new migration with the provided name at the given directory.

func (Migrations) FindInPath

func (m Migrations) FindInPath(dir string, isUp bool) Migration

FindInPath finds migration files in a specific directory. `dir` param is the directory you want to search.

*isUp is a bool representing if you're searching for up or down queries.

type Query

type Query struct {
	Name  string
	Value string
}

Query defines a name/value pair for queries where the name is expected to be a filename and the value is the SQL query

Jump to

Keyboard shortcuts

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