migration

package
v1.1.2-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrationCmd

type MigrationCmd struct {
	MigrationCollection []*gormigrate.Migration
	SeedCollection      []seed.SeedFunc
}

MigrationCmd 迁移 cmd MigrationCollection 迁移集合,数据表迁移方法 SeedCollection 数据填充集合

func New

func New() *MigrationCmd

New MigrationCmd

func (*MigrationCmd) AddMigration

func (mc *MigrationCmd) AddMigration(m ...*gormigrate.Migration)

AddMigration 添加 *gormigrate.Migration

func (*MigrationCmd) AddSeed

func (mc *MigrationCmd) AddSeed(sf ...seed.SeedFunc)

AddSeed 添加 seed

func (*MigrationCmd) Migrate

func (mc *MigrationCmd) Migrate() error

Migrate 执行迁移

func (*MigrationCmd) MigrationLen

func (mc *MigrationCmd) MigrationLen() int

MigrationLen MigrationCollection 的长度

func (*MigrationCmd) Refresh

func (mc *MigrationCmd) Refresh() error

Refresh 重置项目迁移

func (*MigrationCmd) Rollback

func (mc *MigrationCmd) Rollback(migrationId string) error

Rollback 回滚迁移到

func (*MigrationCmd) Seed

func (mc *MigrationCmd) Seed() error

Seed 填充数据

func (*MigrationCmd) SeedlLen

func (mc *MigrationCmd) SeedlLen() int

SeedlLen SeedCollection 的长度

Jump to

Keyboard shortcuts

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