migration

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const TIMESTAMP_LENGTH = 10

Variables

This section is empty.

Functions

func AddMigrator

func AddMigrator(migrator Migrator)

Types

type Migration

type Migration struct {
	ID        int64  `gorm:"column:id;primary_key;auto_increment;"`
	Migration string `gorm:"column:migration;type:varchar(255)"`
	Batch     int64  `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
}

func (*MigrationUtils) Fresh

func (mu *MigrationUtils) Fresh()

func (*MigrationUtils) Install

func (mu *MigrationUtils) Install()

func (*MigrationUtils) Migrate

func (mu *MigrationUtils) Migrate()

func (*MigrationUtils) Refresh

func (mu *MigrationUtils) Refresh()

func (*MigrationUtils) Reset

func (mu *MigrationUtils) Reset()

func (*MigrationUtils) Rollback

func (mu *MigrationUtils) Rollback()

func (*MigrationUtils) SetUp

func (mu *MigrationUtils) SetUp()

Project initialize

func (*MigrationUtils) Status

func (mu *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 *Migrator) string
	Timestamp(migrator *Migrator) uint
}

type MigratorIdentify

type MigratorIdentify struct{}

func (*MigratorIdentify) Name

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

func (*MigratorIdentify) Timestamp

func (m *MigratorIdentify) Timestamp(migrator *Migrator) uint

Jump to

Keyboard shortcuts

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