diff --git a/library/src/com/orm/SugarDb.java b/library/src/com/orm/SugarDb.java index 1e7acc86..dafdd97b 100644 --- a/library/src/com/orm/SugarDb.java +++ b/library/src/com/orm/SugarDb.java @@ -173,6 +173,9 @@ private > void createTable(T table, SQLiteDatabase sqLi } sb.append(", ").append(columnName).append(" ").append(columnType); if(column.isAnnotationPresent(NotNull.class)) { + if (columnType.endsWith(" NULL")) { + sb.delete(sb.length() - 5, sb.length()); + } sb.append(" NOT NULL"); } if(column.isAnnotationPresent(Unique.class)) {