|
|
|
@ -35,9 +35,6 @@ class PokerAnalyticsMigration : RealmMigration { |
|
|
|
// Migrate to version 2 |
|
|
|
// Migrate to version 2 |
|
|
|
if (currentVersion == 1) { |
|
|
|
if (currentVersion == 1) { |
|
|
|
Timber.d("*** Running migration ${currentVersion + 1}") |
|
|
|
Timber.d("*** Running migration ${currentVersion + 1}") |
|
|
|
schema.get("Session")?.let { |
|
|
|
|
|
|
|
it.addField("blinds", String::class.java).setNullable("blinds", true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
schema.rename("FilterElement", "FilterCondition") |
|
|
|
schema.rename("FilterElement", "FilterCondition") |
|
|
|
schema.get("Filter")?.let { |
|
|
|
schema.get("Filter")?.let { |
|
|
|
it.renameField("filterElements", "filterConditions") |
|
|
|
it.renameField("filterElements", "filterConditions") |
|
|
|
@ -52,6 +49,19 @@ class PokerAnalyticsMigration : RealmMigration { |
|
|
|
if (currentVersion == 2) { |
|
|
|
if (currentVersion == 2) { |
|
|
|
Timber.d("*** Running migration ${currentVersion + 1}") |
|
|
|
Timber.d("*** Running migration ${currentVersion + 1}") |
|
|
|
schema.rename("Report", "ReportSetup") |
|
|
|
schema.rename("Report", "ReportSetup") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
schema.get("Session")?.let { |
|
|
|
|
|
|
|
it.addField("blinds", String::class.java).setNullable("blinds", true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
schema.get("FilterCondition")?.let { |
|
|
|
|
|
|
|
it.addRealmListField("booleanValues", Boolean::class.java).setNullable("booleanValues", true) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
schema.get("FilterCondition")?.let { |
|
|
|
|
|
|
|
it.removeField("blindValues") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
currentVersion++ |
|
|
|
currentVersion++ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|