@Test public void testCreateDuplicateDb() { mDbHelper.onCreate(mDbHelper.getWritableDatabase()); }
@Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_TEAMS); db.execSQL(CREATE_EVENTS); db.execSQL(CREATE_AWARDS); db.execSQL(CREATE_MATCHES); db.execSQL(CREATE_MEDIAS); db.execSQL(CREATE_EVENTTEAMS); db.execSQL(CREATE_DISTRICTS); db.execSQL(CREATE_EVENTDETAILS); db.execSQL(CREATE_DISTRICTTEAMS); db.execSQL(CREATE_FAVORITES); db.execSQL(CREATE_SUBSCRIPTIONS); db.execSQL(CREATE_NOTIFICATIONS); if (!tableExists(db, TABLE_SEARCH_EVENTS)) { db.execSQL(CREATE_SEARCH_EVENTS); } if (!tableExists(db, TABLE_SEARCH_TEAMS)) { db.execSQL(CREATE_SEARCH_TEAMS); } }
Database extends SQLiteOpenHelper { @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_TEAMS); db.execSQL(CREATE_EVENTS); db.execSQL(CREATE_AWARDS); db.execSQL(CREATE_MATCHES); db.execSQL(CREATE_MEDIAS); db.execSQL(CREATE_EVENTTEAMS); db.execSQL(CREATE_DISTRICTS); db.execSQL(CREATE_EVENTDETAILS); db.execSQL(CREATE_DISTRICTTEAMS); db.execSQL(CREATE_FAVORITES); db.execSQL(CREATE_SUBSCRIPTIONS); db.execSQL(CREATE_NOTIFICATIONS); if (!tableExists(db, TABLE_SEARCH_EVENTS)) { db.execSQL(CREATE_SEARCH_EVENTS); } if (!tableExists(db, TABLE_SEARCH_TEAMS)) { db.execSQL(CREATE_SEARCH_TEAMS); } } }
Database extends SQLiteOpenHelper { @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_TEAMS); db.execSQL(CREATE_EVENTS); db.execSQL(CREATE_AWARDS); db.execSQL(CREATE_MATCHES); db.execSQL(CREATE_MEDIAS); db.execSQL(CREATE_EVENTTEAMS); db.execSQL(CREATE_DISTRICTS); db.execSQL(CREATE_EVENTDETAILS); db.execSQL(CREATE_DISTRICTTEAMS); db.execSQL(CREATE_FAVORITES); db.execSQL(CREATE_SUBSCRIPTIONS); db.execSQL(CREATE_NOTIFICATIONS); if (!tableExists(db, TABLE_SEARCH_EVENTS)) { db.execSQL(CREATE_SEARCH_EVENTS); } if (!tableExists(db, TABLE_SEARCH_TEAMS)) { db.execSQL(CREATE_SEARCH_TEAMS); } } protected  Database(Context context); }
Database extends SQLiteOpenHelper { @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_TEAMS); db.execSQL(CREATE_EVENTS); db.execSQL(CREATE_AWARDS); db.execSQL(CREATE_MATCHES); db.execSQL(CREATE_MEDIAS); db.execSQL(CREATE_EVENTTEAMS); db.execSQL(CREATE_DISTRICTS); db.execSQL(CREATE_EVENTDETAILS); db.execSQL(CREATE_DISTRICTTEAMS); db.execSQL(CREATE_FAVORITES); db.execSQL(CREATE_SUBSCRIPTIONS); db.execSQL(CREATE_NOTIFICATIONS); if (!tableExists(db, TABLE_SEARCH_EVENTS)) { db.execSQL(CREATE_SEARCH_EVENTS); } if (!tableExists(db, TABLE_SEARCH_TEAMS)) { db.execSQL(CREATE_SEARCH_TEAMS); } } protected  Database(Context context); static synchronized Database getInstance(Context context); TeamsTable getTeamsTable(); EventsTable getEventsTable(); EventDetailsTable getEventDetailsTable(); AwardsTable getAwardsTable(); MatchesTable getMatchesTable(); MediasTable getMediasTable(); EventTeamsTable getEventTeamsTable(); DistrictsTable getDistrictsTable(); DistrictTeamsTable getDistrictTeamsTable(); FavoritesTable getFavoritesTable(); SubscriptionsTable getSubscriptionsTable(); NotificationsTable getNotificationsTable(); @WorkerThread void beginTransaction(); @WorkerThread static void beginTransaction(SQLiteDatabase db); void setTransactionSuccessful(); void endTransaction(); SQLiteDatabase getDb(); @Override void onCreate(SQLiteDatabase db); @Override void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion); Cursor getMatchesForTeamQuery(String query); Cursor getMatchesForEventQuery(String query); }
Database extends SQLiteOpenHelper { @Override public void onCreate(SQLiteDatabase db) { db.execSQL(CREATE_TEAMS); db.execSQL(CREATE_EVENTS); db.execSQL(CREATE_AWARDS); db.execSQL(CREATE_MATCHES); db.execSQL(CREATE_MEDIAS); db.execSQL(CREATE_EVENTTEAMS); db.execSQL(CREATE_DISTRICTS); db.execSQL(CREATE_EVENTDETAILS); db.execSQL(CREATE_DISTRICTTEAMS); db.execSQL(CREATE_FAVORITES); db.execSQL(CREATE_SUBSCRIPTIONS); db.execSQL(CREATE_NOTIFICATIONS); if (!tableExists(db, TABLE_SEARCH_EVENTS)) { db.execSQL(CREATE_SEARCH_EVENTS); } if (!tableExists(db, TABLE_SEARCH_TEAMS)) { db.execSQL(CREATE_SEARCH_TEAMS); } } protected  Database(Context context); static synchronized Database getInstance(Context context); TeamsTable getTeamsTable(); EventsTable getEventsTable(); EventDetailsTable getEventDetailsTable(); AwardsTable getAwardsTable(); MatchesTable getMatchesTable(); MediasTable getMediasTable(); EventTeamsTable getEventTeamsTable(); DistrictsTable getDistrictsTable(); DistrictTeamsTable getDistrictTeamsTable(); FavoritesTable getFavoritesTable(); SubscriptionsTable getSubscriptionsTable(); NotificationsTable getNotificationsTable(); @WorkerThread void beginTransaction(); @WorkerThread static void beginTransaction(SQLiteDatabase db); void setTransactionSuccessful(); void endTransaction(); SQLiteDatabase getDb(); @Override void onCreate(SQLiteDatabase db); @Override void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion); Cursor getMatchesForTeamQuery(String query); Cursor getMatchesForEventQuery(String query); static final String ALL_TEAMS_LOADED_TO_DATABASE_FOR_PAGE; static final String ALL_EVENTS_LOADED_TO_DATABASE_FOR_YEAR; static final String ALL_DISTRICTS_LOADED_TO_DATABASE_FOR_YEAR; static final String TABLE_TEAMS; static final String CREATE_TEAMS; static final String CREATE_EVENTS; static final String CREATE_AWARDS; static final String CREATE_MATCHES; static final String CREATE_MEDIAS; static final String CREATE_EVENTTEAMS; static final String CREATE_DISTRICTS; static final String CREATE_DISTRICTTEAMS; static final String CREATE_EVENTDETAILS; static final String CREATE_FAVORITES; static final String CREATE_SUBSCRIPTIONS; static final String CREATE_SEARCH_TEAMS; static final String CREATE_SEARCH_EVENTS; static final String CREATE_NOTIFICATIONS; }