ver_00001.go 570 B

123456789101112131415161718192021222324252627282930
  1. package db
  2. import (
  3. cherryApp "f1-game/internal/cherry_app"
  4. "fmt"
  5. clog "github.com/cherry-game/cherry/logger"
  6. )
  7. // ver00001 测试用
  8. type ver00001 struct {
  9. }
  10. // Version 手动自增,必需唯一
  11. func (ver00001) Version() int32 {
  12. return 1
  13. }
  14. func (ver00001) Enable() bool {
  15. return false
  16. }
  17. func (p ver00001) Execute() bool {
  18. clog.Infof("Execute %v, [nodeID = %s, dbName = %s]", p.Version(), cherryApp.NodeID(), dbComponent.DB().Name())
  19. return true
  20. }
  21. func (p ver00001) Desc() string {
  22. return fmt.Sprintf("[migrator - %d] Check PlayerTable", p.Version())
  23. }