schema

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MigrationCommandPrefix = "--- #migrate:"
	MigrationDirectionUp   = "up"
	MigrationDirectionDown = "down"
)

Variables

This section is empty.

Functions

func Down

func Down(m Instruction, vault internal.Vault, tableName string) (err error)

func State

func State(m Instruction, vault internal.Vault, tableName string) (exists Instruction, nonExists Instruction, undefined Instruction, err error)

func Up

func Up(m Instruction, vault internal.Vault, tableName string) (err error)

Types

type Instruction

type Instruction []interface {
	ID() string
	MD5() string
}

Instruction is a list of instructions

func ExtractInstructions

func ExtractInstructions(folder http.FileSystem, root string) (Instruction, error)

ExtractInstructions extracts migrations from a folder

func MakeTableInstruction added in v0.0.1

func MakeTableInstruction(tableName string, tableFields interface{}, dialect internal.Dialect) (Instruction, error)

MakeTableInstruction creates a migration instruction for SQLite3 database from a struct

func NewInstruction

func NewInstruction(id, up, down string) Instruction

func Plan

func Plan(m Instruction, vault internal.Vault, tableName string) (items Instruction, err error)

Jump to

Keyboard shortcuts

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