drop duplicated feature
This commit is contained in:
parent
dc980514bd
commit
7fc2459df9
|
@ -44,8 +44,7 @@ const (
|
|||
)
|
||||
|
||||
type DialectFeatures struct {
|
||||
AutoincrMode int // 0 autoincrement column, 1 sequence
|
||||
SupportSequence bool
|
||||
AutoincrMode int // 0 autoincrement column, 1 sequence
|
||||
}
|
||||
|
||||
// Dialect represents a kind of database
|
||||
|
|
|
@ -513,7 +513,7 @@ func (engine *Engine) dumpTables(ctx context.Context, tables []*schemas.Table, w
|
|||
return err
|
||||
}
|
||||
|
||||
if dstTable.AutoIncrement != "" && dstDialect.Features().SupportSequence {
|
||||
if dstTable.AutoIncrement != "" && dstDialect.Features().AutoincrMode == dialects.SequenceAutoincrMode {
|
||||
sqlstr, err = dstDialect.CreateSequenceSQL(ctx, engine.db, utils.SeqName(dstTableName))
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -13,6 +13,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"xorm.io/xorm/dialects"
|
||||
"xorm.io/xorm/internal/utils"
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
@ -53,7 +54,7 @@ func (session *Session) createTable(bean interface{}) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if refTable.AutoIncrement != "" && session.engine.dialect.Features().SupportSequence {
|
||||
if refTable.AutoIncrement != "" && session.engine.dialect.Features().AutoincrMode == dialects.SequenceAutoincrMode {
|
||||
sqlStr, err = session.engine.dialect.CreateSequenceSQL(context.Background(), session.engine.db, utils.SeqName(tableName))
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -164,7 +165,7 @@ func (session *Session) dropTable(beanOrTableName interface{}) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if !session.engine.dialect.Features().SupportSequence {
|
||||
if session.engine.dialect.Features().AutoincrMode == dialects.IncrAutoincrMode {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue