Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/data/NextGenDB.java
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Lines | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { | ||||
db.execSQL("DROP TABLE "+ StopsTable.TABLE_NAME); | db.execSQL("DROP TABLE "+ StopsTable.TABLE_NAME); | ||||
//RECREATE THE TABLES WITH THE NEW SCHEMA | //RECREATE THE TABLES WITH THE NEW SCHEMA | ||||
db.execSQL(SQL_CREATE_LINES_TABLE); | db.execSQL(SQL_CREATE_LINES_TABLE); | ||||
db.execSQL(SQL_CREATE_STOPS_TABLE); | db.execSQL(SQL_CREATE_STOPS_TABLE); | ||||
//tables with constraints | //tables with constraints | ||||
db.execSQL(SQL_CREATE_BRANCH_TABLE); | db.execSQL(SQL_CREATE_BRANCH_TABLE); | ||||
db.execSQL(SQL_CREATE_CONNECTIONS_TABLE); | db.execSQL(SQL_CREATE_CONNECTIONS_TABLE); | ||||
DatabaseUpdateService.startDBUpdate(appContext,0,true); | DatabaseUpdate.requestDBUpdateWithWork(appContext, true); | ||||
} | } | ||||
} | } | ||||
@Override | @Override | ||||
public void onConfigure(SQLiteDatabase db) { | public void onConfigure(SQLiteDatabase db) { | ||||
super.onConfigure(db); | super.onConfigure(db); | ||||
db.execSQL("PRAGMA foreign_keys=ON"); | db.execSQL("PRAGMA foreign_keys=ON"); | ||||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register