migration

package
v0.2.0-nightly.1552569797 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMigrator

func AddMigrator(migrator Migrator)

Types

type Migration

type Migration struct {
	ID        uint   `gorm:"column:id;primary_key;auto_increment;"`
	Migration string `gorm:"column:migration;type:varchar(255)"`
	Batch     uint   `gorm:"column:batch;"`
}

func (*Migration) Name

func (m *Migration) Name() string

func (*Migration) TableName

func (m *Migration) TableName() string

type MigrationUtils

type MigrationUtils struct {
	Migration
	model.BaseModel
	// contains filtered or unexported fields
}

func (*MigrationUtils) Fresh

func (m *MigrationUtils) Fresh()

func (*MigrationUtils) Init

func (m *MigrationUtils) Init(chLog chan interface{})

func (*MigrationUtils) Install

func (m *MigrationUtils) Install()

func (*MigrationUtils) Migrate

func (m *MigrationUtils) Migrate()

func (*MigrationUtils) Refresh

func (m *MigrationUtils) Refresh()

func (*MigrationUtils) Reset

func (m *MigrationUtils) Reset()

func (*MigrationUtils) Rollback

func (m *MigrationUtils) Rollback()

func (*MigrationUtils) SetUp

func (m *MigrationUtils) SetUp()

项目初始化

func (*MigrationUtils) Status

func (m *MigrationUtils) Status()

type Migrator

type Migrator interface {
	Up(db *gorm.DB) *gorm.DB
	Down(db *gorm.DB) *gorm.DB
	MigratorIdentifier
}

type MigratorIdentifier

type MigratorIdentifier interface {
	Name(*Migrator) string
}

type MigratorIdentify

type MigratorIdentify struct{}

func (*MigratorIdentify) Name

func (m *MigratorIdentify) Name(migrator *Migrator) string

Jump to

Keyboard shortcuts

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