mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-08 10:20:26 +08:00
refactor: dbms与标签管理优化
This commit is contained in:
@@ -8,6 +8,8 @@ import (
|
||||
"mayfly-go/pkg/utils/collx"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/may-fly/cast"
|
||||
)
|
||||
|
||||
type PgsqlDialect struct {
|
||||
@@ -141,7 +143,7 @@ func (pd *PgsqlDialect) CopyTable(copy *dbi.DbCopyTable) error {
|
||||
}
|
||||
|
||||
for _, re := range res {
|
||||
colName := anyx.ConvString(re["column_name"])
|
||||
colName := cast.ToString(re["column_name"])
|
||||
if colName != "" {
|
||||
|
||||
// 查询自增列当前最大值
|
||||
@@ -149,7 +151,7 @@ func (pd *PgsqlDialect) CopyTable(copy *dbi.DbCopyTable) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
maxVal := anyx.ConvInt(maxRes[0]["max_val"])
|
||||
maxVal := cast.ToInt(maxRes[0]["max_val"])
|
||||
// 序列起始值为1或当前最大值+1
|
||||
if maxVal <= 0 {
|
||||
maxVal = 1
|
||||
|
||||
Reference in New Issue
Block a user