migration

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

migration

a migration tool based on gorm

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ins ...Migrates)

Add note "ins" is a structure instance that implements migrates No need to implement all methods

func AutoMigrate

func AutoMigrate() error

AutoMigrate It needs to be written after the "Add" method and finally executed to ensure correct migration

func SetGorm

func SetGorm(db *gorm.DB)

Types

type Migrates

type Migrates interface {
	Run() string
	Rollback() string
	ChangeLog() string
	Version() int64
}

Jump to

Keyboard shortcuts

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