支持sqlite表结构自动生成

This commit is contained in:
2024-06-17 17:50:38 +08:00
parent 24aa0d3f9b
commit 572ed2b0f3
3 changed files with 50 additions and 26 deletions

View File

@ -115,6 +115,9 @@ func (f *Field) ToString() (string, error) {
return "", err
}
fieldTpl := f.getFieldTpl()
if f.PrimaryKey && DatabaseDriver == consts.DatabaseDriverSqlite3 {
f.Type = "INTEGER PRIMARY KEY AUTOINCREMENT"
}
dataReplaceTable := map[string]string{
FieldName: f.Name, // 字段名
FieldType: f.Type, // 字段类型