@@ -9,7 +9,8 @@ r23: { | |||
html: ~ | |||
text: ~ | |||
security: ~ | |||
fixes: ~ | |||
fixes: | |||
- Fix SQLite INTEGER PRIMARY KEY AUTOINCREMENT mapping | |||
changes: | |||
- Improved automatic date conversions | |||
- Revised data type adapters to be specified separately with the @TypeAdapter annotation |
@@ -337,12 +337,16 @@ public class SQLDialectDefault implements SQLDialect { | |||
protected boolean isIntegerType(String dataType) { | |||
if ("INT".equals(dataType)) { | |||
return true; | |||
} else if ("BIGINT".equals(dataType)) { | |||
} else if ("INTEGER".equals(dataType)) { | |||
return true; | |||
} else if ("TINYINT".equals(dataType)) { | |||
return true; | |||
} else if ("SMALLINT".equals(dataType)) { | |||
return true; | |||
} else if ("MEDIUMINT".equals(dataType)) { | |||
return true; | |||
} else if ("BIGINT".equals(dataType)) { | |||
return true; | |||
} | |||
return false; | |||
} |
@@ -49,6 +49,29 @@ public class SQLDialectSQLite extends SQLDialectDefault { | |||
return "CREATE VIEW IF NOT EXISTS"; | |||
} | |||
@Override | |||
public String convertSqlType(String sqlType) { | |||
if (isIntegerType(sqlType)) { | |||
return "INTEGER"; | |||
} | |||
return sqlType; | |||
} | |||
@Override | |||
protected boolean prepareColumnDefinition(StatementBuilder buff, String dataType, | |||
boolean isAutoIncrement, boolean isPrimaryKey) { | |||
String convertedType = convertSqlType(dataType); | |||
buff.append(convertedType); | |||
if (isPrimaryKey) { | |||
buff.append(" PRIMARY KEY"); | |||
if (isAutoIncrement) { | |||
buff.append(" AUTOINCREMENT"); | |||
} | |||
return true; | |||
} | |||
return false; | |||
} | |||
@Override | |||
public <T> void prepareDropView(SQLStatement stat, TableDefinition<T> def) { | |||
StatementBuilder buff = new StatementBuilder("DROP VIEW IF EXISTS " |