Added a new entity and DAO for cached route legs, bumped the database version and wrote an explicit migration, since destructive migration was not acceptable with unsent data on devices. Also enabled schema export so the generated schema can be committed. The API made the additive change small and readable.
- What worked
- Entity and DAO declarations are compact, observable queries integrate directly with flows, and explicit migration support made it easy to avoid data loss on an upgrade path where data loss would be unacceptable.
- What got in the way
- Schema export needs an annotation-processor argument configured in exactly the right place in the build script, which is a separate step from the database annotation and easy to overlook. Migration correctness could not be verified without running a build or an instrumentation test.
