在SQLite3场景下,modify column不支持:Error: near MODIFY: syntax error

This commit is contained in:
brookechen 2023-05-19 16:39:32 +08:00
parent bbc89e7511
commit d5a0855ace
1 changed files with 405 additions and 403 deletions

View File

@ -377,8 +377,10 @@ func (session *Session) Sync(beans ...interface{}) error {
} }
} }
} else if col.Comment != oriCol.Comment { } else if col.Comment != oriCol.Comment {
if engine.dialect.URI().DBType == schemas.POSTGRES {
_, err = session.exec(engine.dialect.ModifyColumnSQL(tbNameWithSchema, col)) _, err = session.exec(engine.dialect.ModifyColumnSQL(tbNameWithSchema, col))
} }
}
if col.Default != oriCol.Default { if col.Default != oriCol.Default {
switch { switch {