Search code examples
androidandroid-roomandroid-architecture-components

Will Room migrations be run for new users?


Let's say I have 2 migrations (1-->2, 2-->3). If a new user comes along and installs the app, will all the migrations be run, or will they just get the version 3 schema database?


Solution

  • They'll just get version 3. Databases internally track their database version and that is what Room uses to check if a migration is needed. In the case of a brand new database, Room just starts the user at the version of the database you specify.