Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit b58f2b7

Browse files
Merge pull request #3014 from wordpress-mobile/fix/shipping-methods-migration
Fix shipping methods migration
2 parents 14fcce7 + b5ed006 commit b58f2b7

File tree

2 files changed

+18
-35
lines changed
  • plugins/woocommerce
    • schemas/org.wordpress.android.fluxc.persistence.WCAndroidDatabase
    • src/androidTest/java/org/wordpress/android/fluxc/persistence

2 files changed

+18
-35
lines changed

plugins/woocommerce/schemas/org.wordpress.android.fluxc.persistence.WCAndroidDatabase/35.json

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"formatVersion": 1,
33
"database": {
44
"version": 35,
5-
"identityHash": "2b2e3799733db41ef697c524296acc82",
5+
"identityHash": "a01f7f90e7751f29876dda9a73c49ccc",
66
"entities": [
77
{
88
"tableName": "AddonEntity",
@@ -1657,45 +1657,12 @@
16571657
},
16581658
"indices": [],
16591659
"foreignKeys": []
1660-
},
1661-
{
1662-
"tableName": "ShippingMethod",
1663-
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `localSiteId` INTEGER NOT NULL, `title` TEXT NOT NULL, PRIMARY KEY(`localSiteId`, `id`))",
1664-
"fields": [
1665-
{
1666-
"fieldPath": "id",
1667-
"columnName": "id",
1668-
"affinity": "TEXT",
1669-
"notNull": true
1670-
},
1671-
{
1672-
"fieldPath": "localSiteId",
1673-
"columnName": "localSiteId",
1674-
"affinity": "INTEGER",
1675-
"notNull": true
1676-
},
1677-
{
1678-
"fieldPath": "title",
1679-
"columnName": "title",
1680-
"affinity": "TEXT",
1681-
"notNull": true
1682-
}
1683-
],
1684-
"primaryKey": {
1685-
"columnNames": [
1686-
"localSiteId",
1687-
"id"
1688-
],
1689-
"autoGenerate": false
1690-
},
1691-
"indices": [],
1692-
"foreignKeys": []
16931660
}
16941661
],
16951662
"views": [],
16961663
"setupQueries": [
16971664
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
1698-
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '2b2e3799733db41ef697c524296acc82')"
1665+
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'a01f7f90e7751f29876dda9a73c49ccc')"
16991666
]
17001667
}
17011668
}

plugins/woocommerce/src/androidTest/java/org/wordpress/android/fluxc/persistence/MigrationTests.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,22 @@ class MigrationTests {
295295
}
296296
}
297297

298+
@Test
299+
fun testMigration34to35() {
300+
helper.apply {
301+
createDatabase(TEST_DB, 34).close()
302+
runMigrationsAndValidate(TEST_DB, 35, false)
303+
}
304+
}
305+
306+
@Test
307+
fun testMigration35to36() {
308+
helper.apply {
309+
createDatabase(TEST_DB, 35).close()
310+
runMigrationsAndValidate(TEST_DB, 36, false)
311+
}
312+
}
313+
298314
companion object {
299315
private const val TEST_DB = "migration-test"
300316
}

0 commit comments

Comments
 (0)