Skip to content

Commit

Permalink
Merge pull request #2916 from wordpress-mobile/release/2.55.2
Browse files Browse the repository at this point in the history
Merge Release/2.55.2 in release/2.57.1
  • Loading branch information
Thomas Horta authored Nov 29, 2023
2 parents 8076d17 + 01c8802 commit b473446
Showing 1 changed file with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ abstract class WPAndroidDatabase : RoomDatabase() {
.addMigrations(MIGRATION_18_19)
.addMigrations(MIGRATION_19_20)
.addMigrations(MIGRATION_20_21)
.addMigrations(MIGRATION_21_22)
.build()

val MIGRATION_1_2 = object : Migration(1, 2) {
Expand Down Expand Up @@ -311,40 +310,5 @@ abstract class WPAndroidDatabase : RoomDatabase() {
}
}
}

val MIGRATION_21_22 = object : Migration(21, 22) {
override fun migrate(database: SupportSQLiteDatabase) {
// migrate old data to new table schema
database.apply {
execSQL(
"CREATE TABLE IF NOT EXISTS `BloggingPrompts_new` (" +
"`id` INTEGER NOT NULL," +
"`siteLocalId` INTEGER NOT NULL," +
"`text` TEXT NOT NULL," +
"`date` TEXT NOT NULL," +
"`isAnswered` INTEGER NOT NULL," +
"`respondentsCount` INTEGER NOT NULL," +
"`attribution` TEXT NOT NULL," +
"`respondentsAvatars` TEXT NOT NULL," +
"`answeredLink` TEXT NOT NULL," +
"PRIMARY KEY(`date`)" +
")"
)

val tagPrefix = "https://wordpress.com/tag/dailyprompt-"
execSQL(
"INSERT INTO BloggingPrompts_new (" +
"id, siteLocalId, text, date, isAnswered, " +
"respondentsCount, attribution, respondentsAvatars, answeredLink) " +
"SELECT id, siteLocalId, text, date, isAnswered, " +
"respondentsCount, attribution, respondentsAvatars, " +
"'$tagPrefix' || id FROM BloggingPrompts"
)

execSQL("DROP TABLE `BloggingPrompts`")
execSQL("ALTER TABLE `BloggingPrompts_new` RENAME TO `BloggingPrompts`")
}
}
}
}
}

0 comments on commit b473446

Please sign in to comment.