diff --git a/oeffi/src/de/schildbach/oeffi/Application.java b/oeffi/src/de/schildbach/oeffi/Application.java index a61a66a..742b52a 100644 --- a/oeffi/src/de/schildbach/oeffi/Application.java +++ b/oeffi/src/de/schildbach/oeffi/Application.java @@ -103,39 +103,6 @@ public class Application extends android.app.Application { final Stopwatch watch = Stopwatch.createStarted(); - // clean up databases - QueryHistoryProvider.cleanupQueryHistory(this); - - // 2017-01-03: migrate OOEVV to use OEBB - migrateSelectedNetwork(NetworkId.OOEVV.name(), NetworkId.OEBB); - Downloader.deleteDownload(new File(getFilesDir(), NetworkId.OOEVV.name().toLowerCase(Locale.ENGLISH) + ".db")); - - // 2017-01-13: remove Melbourne - final String MET = "MET"; - Downloader.deleteDownload(new File(getFilesDir(), MET.toLowerCase(Locale.ENGLISH) + ".db")); - - // 2017-02-06: remove Philadelphia - final String SEPTA = "SEPTA"; - Downloader.deleteDownload(new File(getFilesDir(), SEPTA.toLowerCase(Locale.ENGLISH) + ".db")); - - // 2017-02-16: remove Provence-Alpes-Côte d'Azur - final String PACA = "PACA"; - migrateSelectedNetwork(PACA, NetworkId.RT); - Downloader.deleteDownload(new File(getFilesDir(), PACA.toLowerCase(Locale.ENGLISH) + ".db")); - - // 2017-08-31: migrate BVB to use NVBW - final String BVB = "BVB"; - migrateSelectedNetwork(BVB, NetworkId.NVBW); - Downloader.deleteDownload(new File(getFilesDir(), BVB.toLowerCase(Locale.ENGLISH) + ".db")); - - // 2017-09-19: migrate VBB to new station IDs - FavoriteStationsProvider.migrateFavoriteStationIds(this, NetworkId.VBB, "9000000", "9600000", 891000000); - QueryHistoryProvider.migrateQueryHistoryIds(this, NetworkId.VBB, "9000000", "9600000", 891000000); - - // 2017-09-19: migrate BVG to new station IDs - FavoriteStationsProvider.migrateFavoriteStationIds(this, NetworkId.BVG, "9000000", "9600000", 891000000); - QueryHistoryProvider.migrateQueryHistoryIds(this, NetworkId.BVG, "9000000", "9600000", 891000000); - // 2018-07-06: migrate IVB to use OEBB final String IVB = "IVB"; migrateSelectedNetwork(IVB, NetworkId.OEBB); diff --git a/oeffi/src/de/schildbach/oeffi/directions/QueryHistoryProvider.java b/oeffi/src/de/schildbach/oeffi/directions/QueryHistoryProvider.java index 3d45fce..520aac3 100644 --- a/oeffi/src/de/schildbach/oeffi/directions/QueryHistoryProvider.java +++ b/oeffi/src/de/schildbach/oeffi/directions/QueryHistoryProvider.java @@ -436,27 +436,6 @@ public class QueryHistoryProvider extends ContentProvider { helper.close(); } - /** - * Restricted to usage by {@link Application#onCreate()} only. - */ - public static void cleanupQueryHistory(final Context context) { - final QueryHistoryHelper helper = new QueryHistoryHelper(context); - final SQLiteDatabase db = helper.getWritableDatabase(); - - db.beginTransaction(); - try { - db.execSQL("DELETE FROM " + DATABASE_TABLE + " WHERE " + KEY_FROM_TYPE + "=" + TYPE_ANY + " AND " - + KEY_FROM_ID + " IS NOT NULL"); - db.execSQL("DELETE FROM " + DATABASE_TABLE + " WHERE " + KEY_TO_TYPE + "=" + TYPE_ANY + " AND " + KEY_TO_ID - + " IS NOT NULL"); - db.setTransactionSuccessful(); - } finally { - db.endTransaction(); - } - - helper.close(); - } - private static class QueryHistoryHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "oeffi"; private static final int DATABASE_VERSION = 6;