mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	feat: 数据迁移新增实时日志&数据库游标遍历查询问题修复
This commit is contained in:
		@@ -2,13 +2,13 @@ package entity
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"mayfly-go/pkg/model"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type DbTransferTask struct {
 | 
			
		||||
	model.Model
 | 
			
		||||
 | 
			
		||||
	RunningState int `orm:"column(running_state)" json:"runningState"` // 运行状态 1运行中  2待运行
 | 
			
		||||
	RunningState DbTransferRunningState `orm:"column(running_state)" json:"runningState"` // 运行状态
 | 
			
		||||
	LogId        uint64                 `json:"logId"`
 | 
			
		||||
 | 
			
		||||
	CheckedKeys string `orm:"column(checked_keys)" json:"checkedKeys"` // 选中需要迁移的表
 | 
			
		||||
	DeleteTable int    `orm:"column(delete_table)" json:"deleteTable"` // 创建表前是否删除表
 | 
			
		||||
@@ -33,28 +33,14 @@ func (d *DbTransferTask) TableName() string {
 | 
			
		||||
	return "t_db_transfer_task"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type DbTransferLog struct {
 | 
			
		||||
	model.IdModel
 | 
			
		||||
	TaskId      uint64     `orm:"column(task_id)" json:"taskId"` // 任务表id
 | 
			
		||||
	CreateTime  *time.Time `orm:"column(create_time)" json:"createTime"`
 | 
			
		||||
	DataSqlFull string     `orm:"column(data_sql_full)" json:"dataSqlFull"` // 执行的完整sql
 | 
			
		||||
	ResNum      int        `orm:"column(res_num)" json:"resNum"`            // 收到数据条数
 | 
			
		||||
	ErrText     string     `orm:"column(err_text)" json:"errText"`          // 错误日志
 | 
			
		||||
	Status      int8       `orm:"column(status)" json:"status"`             // 状态:1.成功  -1.失败
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (d *DbTransferLog) TableName() string {
 | 
			
		||||
	return "t_db_transfer_log"
 | 
			
		||||
}
 | 
			
		||||
type DbTransferRunningState int8
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	DbTransferTaskStatusEnable  int = 1  // 启用状态
 | 
			
		||||
	DbTransferTaskStatusDisable int = -1 // 禁用状态
 | 
			
		||||
 | 
			
		||||
	DbTransferTaskStateSuccess int = 1  // 执行成功状态
 | 
			
		||||
	DbTransferTaskStateRunning int = 2  // 执行成功状态
 | 
			
		||||
	DbTransferTaskStateFail    int = -1 // 执行失败状态
 | 
			
		||||
 | 
			
		||||
	DbTransferTaskRunStateRunning int = 1 // 运行中状态
 | 
			
		||||
	DbTransferTaskRunStateStop    int = 2 // 手动停止状态
 | 
			
		||||
	DbTransferTaskRunStateSuccess DbTransferRunningState = 2  // 执行成功
 | 
			
		||||
	DbTransferTaskRunStateRunning DbTransferRunningState = 1  // 运行中状态
 | 
			
		||||
	DbTransferTaskRunStateFail    DbTransferRunningState = -1 // 执行失败
 | 
			
		||||
	DbTransferTaskRunStateStop    DbTransferRunningState = -2 // 手动终止
 | 
			
		||||
)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user