File tree Expand file tree Collapse file tree
core/src/main/java/me/zort/sqllib Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import me .zort .sqllib .api .repository .SQLTableRepository ;
66import me .zort .sqllib .internal .annotation .JsonField ;
77import me .zort .sqllib .internal .annotation .NullableField ;
8+ import me .zort .sqllib .internal .annotation .PrimaryKey ;
89import me .zort .sqllib .util .Arrays ;
910import me .zort .sqllib .util .Validator ;
1011import org .jetbrains .annotations .ApiStatus ;
@@ -143,8 +144,11 @@ private String recognizeFieldTypeToDbType(Field field) {
143144 dbType = "FLOAT" ;
144145 }
145146
147+ if (field .isAnnotationPresent (PrimaryKey .class ))
148+ dbType += " PRIMARY KEY" ;
149+
146150 if (Validator .validateAutoIncrement (field ))
147- dbType += " PRIMARY KEY " + (isSQLite () ? "AUTOINCREMENT" : "AUTO_INCREMENT" );
151+ dbType += " " + (isSQLite () ? "AUTOINCREMENT" : "AUTO_INCREMENT" );
148152
149153 return dbType ;
150154 }
You can’t perform that action at this time.
0 commit comments