version

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	Storer    Storer
	IsMigrate *bool
}

Core ...

func NewCore

func NewCore(store Storer) *Core

NewCore ...

func (*Core) IsAutoMigrate

func (c *Core) IsAutoMigrate(currentVer, remark string) bool

IsAutoMigrate 是否需要进行表迁移?

func (Core) RecordVersion

func (c Core) RecordVersion(currentVer, remark string) error

RecordVersion 记录当前版本号

type Storer

type Storer interface {
	First(*Version) error
	Add(*Version) error
}

Storer ...

type Version

type Version struct {
	orm.Model
	Version string // 版本
	Remark  string // 迁移说明
}

Version 数据库版本记录 每次迁移,则创建一条记录 每次程序启动,则按 id 倒序获取最后一条记录,当小于硬编码的版本号时,进行数据库迁移

func (*Version) TableName

func (*Version) TableName() string

TableName ...

Directories

Path Synopsis
store

Jump to

Keyboard shortcuts

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