mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-31 03:46:34 +08:00
fix: fixed some issues
This commit is contained in:
@@ -190,7 +190,7 @@ func (sg *SQLGenerator) batchInsertSimple(tableName string, columns []dbi.Column
|
||||
// 设置允许填充自增列之后,显示指定列名可以插入自增列
|
||||
identityInsertOn := ""
|
||||
for _, column := range columns {
|
||||
if column.IsIdentity {
|
||||
if column.AutoIncrement {
|
||||
identityInsertOn = fmt.Sprintf("SET IDENTITY_INSERT [%s].[%s] ON", schema, tableName)
|
||||
}
|
||||
}
|
||||
@@ -221,7 +221,7 @@ func (sg *SQLGenerator) batchInsertMerge(tableName string, columns []dbi.Column,
|
||||
hashIdentity := false
|
||||
|
||||
for _, col := range columns {
|
||||
if col.IsIdentity {
|
||||
if col.AutoIncrement {
|
||||
hashIdentity = true
|
||||
identityCols = append(identityCols, col.ColumnName)
|
||||
}
|
||||
@@ -286,7 +286,7 @@ func (sg *SQLGenerator) genColumnBasicSql(quoter dbi.Quoter, column dbi.Column)
|
||||
dataType := column.DataType
|
||||
|
||||
incr := ""
|
||||
if column.IsIdentity {
|
||||
if column.AutoIncrement {
|
||||
incr = " IDENTITY(1,1)"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user