MCPcopy
hub / github.com/mindoc-org/mindoc / MigrationDatabase

Interface MigrationDatabase

commands/migrate/migrate.go:33–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31)
32
33type MigrationDatabase interface {
34 //获取当前的版本
35 Version() int64
36 //校验当前是否可更新
37 ValidUpdate(version int64) error
38 //校验并备份表结构
39 ValidForBackupTableSchema() error
40 //校验并更新表结构
41 ValidForUpdateTableSchema() error
42 //恢复旧数据
43 MigrationOldTableData() error
44 //插入新数据
45 MigrationNewTableData() error
46 //增加迁移记录
47 AddMigrationRecord(version int64) error
48 //最后的清理工作
49 MigrationCleanup() error
50 //回滚本次迁移
51 RollbackMigration() error
52}
53
54type migrationCache struct {
55 items *list.List

Callers 9

RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65
RunMigrationFunction · 0.65

Implementers 1

MigrationVersion03commands/migrate/migrate_v03.go

Calls

no outgoing calls

Tested by

no test coverage detected