Skip to content

Commit 9489e7a

Browse files
committed
Only create SQL views for database version 7 and above
1 parent bee9dc9 commit 9489e7a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/src/org/gnucash/android/db/DatabaseAdapter.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ public DatabaseAdapter(Context context) {
6262
mDbHelper = new DatabaseHelper(context);
6363
mContext = context.getApplicationContext();
6464
open();
65-
createTempView();
65+
66+
if (mDb.getVersion() >= DatabaseSchema.SPLITS_DB_VERSION) {
67+
createTempView();
68+
}
6669
}
6770

6871
/**
@@ -74,7 +77,10 @@ public DatabaseAdapter(SQLiteDatabase db) {
7477
this.mContext = GnuCashApplication.getAppContext();
7578
if (!db.isOpen() || db.isReadOnly())
7679
throw new IllegalArgumentException("Database not open or is read-only. Require writeable database");
77-
createTempView();
80+
81+
if (mDb.getVersion() >= DatabaseSchema.SPLITS_DB_VERSION) {
82+
createTempView();
83+
}
7884
}
7985

8086
private void createTempView() {

0 commit comments

Comments
 (0)