order

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DropDefault = Raw(`DROP DEFAULT`)
View Source
const DropNotNull = Raw(`DROP NOT NULL`)
View Source
const SetNotNull = Raw(`SET NOT NULL`)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddColumn

type AddColumn struct {
	ColumnName       string
	DataType         string
	NumericPrecision int
	NumericScale     int
	NotNull          bool
	Default          string
}

func (AddColumn) String

func (x AddColumn) String() string

type AddPrimaryKey

type AddPrimaryKey struct {
	Columns []string
}

func (AddPrimaryKey) String

func (x AddPrimaryKey) String() string

type AlterColumn

type AlterColumn struct {
	ColumnName string
	Change     Change
}

AlterColumn is a child change of AlterTable, and accepts a child column change.

func (AlterColumn) String

func (x AlterColumn) String() string

type AlterTable

type AlterTable struct {
	SchemaName string
	TableName  string
	Change     Change
}

Alter an existing table. This change occurs when you have matching table names but the schema doesn't match.

func (AlterTable) String

func (x AlterTable) String() string

type Change

type Change interface {
	String() string
}

func Changes

func Changes(a, b db.DatabaseNode) []Change

type CreateExtension

type CreateExtension struct {
	ExtName string
}

Create a missing extension.

func (CreateExtension) String

func (x CreateExtension) String() string

type CreateIndex

type CreateIndex struct {
	SchemaName string
	TableName  string
	IndexName  string
	Exprs      []string
	Unique     bool
}

func (CreateIndex) String

func (x CreateIndex) String() string

type CreateSchema

type CreateSchema struct {
	SchemaName string
}

func (CreateSchema) String

func (x CreateSchema) String() string

type CreateTable

type CreateTable struct {
	SchemaName string
	TableName  string
}

func (CreateTable) String

func (x CreateTable) String() string

type DropColumn

type DropColumn struct {
	ColumnName string
}

DropColumn drops an existing column from existing table. It's a child change that requires a parent AlterTable.

func (DropColumn) String

func (x DropColumn) String() string

type DropConstraint

type DropConstraint struct {
	ConstraintName string
}

DropConstraint is a nested change that requires a parent AlterTable change.

func (DropConstraint) String

func (x DropConstraint) String() string

type DropIndex

type DropIndex struct {
	SchemaName string
	IndexName  string
}

func (DropIndex) String

func (x DropIndex) String() string

type DropTable

type DropTable struct {
	SchemaName string
	TableName  string
}

Drop an existing table. This change occurs when you have a table name in the old schema with no match in the new schema.

func (DropTable) String

func (x DropTable) String() string

type Raw

type Raw string

func (Raw) String

func (s Raw) String() string

type SetDataType

type SetDataType struct {
	DataType         string
	NumericPrecision int
	NumericScale     int
	Using            string
}

SetDataType is a child change of AlterColumn. It changes a data using a cast function.

func (SetDataType) String

func (x SetDataType) String() string

type SetDefault

type SetDefault struct {
	Default string
}

func (SetDefault) String

func (x SetDefault) String() string

Jump to

Keyboard shortcuts

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