Skip to content

Commit

Permalink
fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyMontoya committed Oct 27, 2015
2 parents 30c3900 + 963716e commit 9aa3b3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/src/main/java/com/orm/SchemaGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private boolean executeSugarUpgrade(SQLiteDatabase db, int oldVersion, int newVe
boolean isSuccess = false;

try {
List<String> files = Arrays.asList(context.getAssets().list("sugar_upgrades"));
List<String> files = Arrays.asList(this.context.getAssets().list("sugar_upgrades"));
Collections.sort(files, new NumberComparator());
for (String file : files) {
Log.i(SUGAR, "filename : " + file);
Expand All @@ -94,7 +94,7 @@ private boolean executeSugarUpgrade(SQLiteDatabase db, int oldVersion, int newVe

private void executeScript(SQLiteDatabase db, String file) {
try {
InputStream is = context.getAssets().open("sugar_upgrades/" + file);
InputStream is = this.context.getAssets().open("sugar_upgrades/" + file);
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String line;
while ((line = reader.readLine()) != null) {
Expand All @@ -109,10 +109,10 @@ private void executeScript(SQLiteDatabase db, String file) {
}

private void createTable(Class<?> table, SQLiteDatabase sqLiteDatabase) {
Log.i(SUGAR, "Create table");
Log.i(SUGAR, "Create table if not exists");
List<Field> fields = ReflectionUtil.getTableFields(table);
String tableName = NamingHelper.toSQLName(table);
StringBuilder sb = new StringBuilder("CREATE TABLE ");
StringBuilder sb = new StringBuilder("CREATE TABLE IF NOT EXISTS ");
sb.append(tableName).append(" ( ID INTEGER PRIMARY KEY AUTOINCREMENT ");

for (Field column : fields) {
Expand Down

0 comments on commit 9aa3b3e

Please sign in to comment.