Repository navigation
Commit d3dd422
committed
fix(db): stop MIGRATION_13_14 creating indexes no entity declares
f0fca7b (in v1.7.37 and v1.7.38) added evidenceExpiresAt to SpamNumber and
SpamPrefix without an @Index, but MIGRATION_13_14 also created
index_spam_numbers_evidenceExpiresAt and index_spam_prefixes_evidenceExpiresAt.
Room validates the schema after migrating, found indexes the entities don't
have, threw "Migration didn't properly handle: spam_numbers" and rolled the
upgrade back. A phone whose database was v13 or older therefore failed to
open it on every launch after updating.
Because validation always failed and rolled back, no database ever committed
those indexes, so dropping the two CREATE INDEX statements fixes the path
without a version bump. The column default '[]' left by ADD COLUMN is
tolerated by Room's check (the entity declares no default).
Verified on an API 35 emulator: the six instrumented AppDatabaseMigrationTest
cases (v5, 6, 7, 8, 9 and 11 to current) all failed before the change and all
pass after it. Nothing runs the instrumented suite, which is why this shipped;
running the migration check in a JVM gate is now a P1 roadmap item. 1381 JVM
tests pass; lint, ktlint and detekt are clean.1 parent d66b6b1 commit d3dd422
2 files changed
Lines changed: 14 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
200 | 207 | | |
201 | 208 | | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
206 | 213 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | 214 | | |
216 | 215 | | |
217 | 216 | | |
| |||
0 commit comments