About preloading .db files, what means this senten...
# room
p
About preloading .db files, what means this sentence in the room documentation?
Copy code
Note: Automated Room migrations rely on the generated database schema for both the old and the new versions of the database. If exportSchema is set to false, or if you have not yet compiled the database with the new version number, then automated migrations fail.
Specifically the part on if you have not yet compiled the database with the new version number. What is refering to? maybe google is telling that we need to open the sqlite file with an external tool and edit the pragma user_version value? Is that mandatory to make room migrations work?
a
Automated Room migrations rely on the generated database schema for both the old and the new versions
Version are specified like this as can be seen here. Room generates a schema of your database. You can see schemas here. When you build your code, a schema is generated corresponding to version number provided. From the examples you can see that
1.json
refers to version 1 .. all the way upto
14.json
.
if you have not yet compiled the database with the new version number
From what we have gathered so far. This means that whenever the db schema changes, you need to bump the version number and compile your code so it can create
x.json
file as,
Automated Room migrations rely on the generated database schema for both the old and the new versions of the database.
You need this if you want
AutomatedMigrations
to work.