@@ -105,7 +105,6 @@ abstract class WPAndroidDatabase : RoomDatabase() {
105105 .addMigrations(MIGRATION_18_19 )
106106 .addMigrations(MIGRATION_19_20 )
107107 .addMigrations(MIGRATION_20_21 )
108- .addMigrations(MIGRATION_21_22 )
109108 .build()
110109
111110 val MIGRATION_1_2 = object : Migration (1 , 2 ) {
@@ -311,40 +310,5 @@ abstract class WPAndroidDatabase : RoomDatabase() {
311310 }
312311 }
313312 }
314-
315- val MIGRATION_21_22 = object : Migration (21 , 22 ) {
316- override fun migrate (database : SupportSQLiteDatabase ) {
317- // migrate old data to new table schema
318- database.apply {
319- execSQL(
320- " CREATE TABLE IF NOT EXISTS `BloggingPrompts_new` (" +
321- " `id` INTEGER NOT NULL," +
322- " `siteLocalId` INTEGER NOT NULL," +
323- " `text` TEXT NOT NULL," +
324- " `date` TEXT NOT NULL," +
325- " `isAnswered` INTEGER NOT NULL," +
326- " `respondentsCount` INTEGER NOT NULL," +
327- " `attribution` TEXT NOT NULL," +
328- " `respondentsAvatars` TEXT NOT NULL," +
329- " `answeredLink` TEXT NOT NULL," +
330- " PRIMARY KEY(`date`)" +
331- " )"
332- )
333-
334- val tagPrefix = " https://wordpress.com/tag/dailyprompt-"
335- execSQL(
336- " INSERT INTO BloggingPrompts_new (" +
337- " id, siteLocalId, text, date, isAnswered, " +
338- " respondentsCount, attribution, respondentsAvatars, answeredLink) " +
339- " SELECT id, siteLocalId, text, date, isAnswered, " +
340- " respondentsCount, attribution, respondentsAvatars, " +
341- " '$tagPrefix ' || id FROM BloggingPrompts"
342- )
343-
344- execSQL(" DROP TABLE `BloggingPrompts`" )
345- execSQL(" ALTER TABLE `BloggingPrompts_new` RENAME TO `BloggingPrompts`" )
346- }
347- }
348- }
349313 }
350314}
0 commit comments