Skip to content

Commit

Permalink
Clean up table creation for date and calendar fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Huu Nguyen committed Jul 11, 2014
1 parent 2ca05f4 commit 336d093
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/src/com/orm/SugarDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ private <T extends SugarRecord<?>> 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)) {
Expand Down

0 comments on commit 336d093

Please sign in to comment.