interfaces

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blueprint

type Blueprint interface {
	Id(name string, length int) Blueprint
	String(name string, length int) Blueprint
	Text(name string) Blueprint
	LongText(name string) Blueprint
	MediumText(name string) Blueprint
	CustomSql(sql string) Blueprint
	BigInt(name string, length int) Blueprint
	Integer(name string, length int) Blueprint
	Decimal(name string, length, decimals int) Blueprint
	Date(name string) Blueprint
	Comment(value string) Blueprint
	Collate(collate string) Blueprint
	TableComment(value string) Blueprint
	Boolean(name string) Blueprint
	DateTime(name string) Blueprint
	Nullable() Blueprint
	Unsigned() Blueprint
	Modify() Blueprint
	Unique(column ...string) Blueprint
	Index(column ...string) Blueprint
	IndexName(name string) Blueprint
	Default(value interface{}) Blueprint
	Foreign(name string) ForeignBlueprint
	Primary(name ...string) Blueprint
	DropColumn(column string)
	DropUnique(name string)
	DropIndex(name string)
	DropForeign(name string)
	DropPrimary()
	Timestamps()
	DeletedAt(index bool)
}

type ForeignBlueprint

type ForeignBlueprint interface {
	Reference(name string) ForeignBlueprint
	On(table string) ForeignBlueprint
	OnUpdate(action string) ForeignBlueprint
	OnDelete(action string) ForeignBlueprint
}

type Migration

type Migration interface {
	Up() error
	Down() error
}

type Migrator

type Migrator interface {
	CheckTable() (bool, error)
	CreateTable() error
	DropTableIfExists() error
	DropAllTable() error
	GetMigrations() ([]model.Migration, error)
	WriteRecord(migration string, batch int) error
	DeleteRecord(id int) error
}

type Schema

type Schema interface {
	Create(table string, schemaFunc func(Blueprint)) error
	Table(table string, schemaFunc func(Blueprint)) error
	DropIfExists(table string) error
}

type SchemaWithSeeder

type SchemaWithSeeder interface {
	Create(table string, schemaFunc func(Blueprint)) Seeder
	Table(table string, schemaFunc func(Blueprint)) error
	DropIfExists(table string) error
}

type Seeder

type Seeder interface {
	error
	Seed(data ...map[string]interface{}) error
}

Jump to

Keyboard shortcuts

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