Skip to content

Instantly share code, notes, and snippets.

@gokmenbayram
Created November 11, 2022 10:49
Show Gist options
  • Save gokmenbayram/4e0e26c5d8d3f838c8579974e51563d9 to your computer and use it in GitHub Desktop.
Save gokmenbayram/4e0e26c5d8d3f838c8579974e51563d9 to your computer and use it in GitHub Desktop.
AutoMigrationSpec
@Database(
version = 2,
entities = [ User.class ],
autoMigrations = [
AutoMigration (
from = 1,
to = 2,
spec = UserDatabase.UserAutoMigration::class
)
]
)
abstract class UserDatabase : RoomDatabase {
@RenameTable(fromTableName = "User", toTableName = "SuperUser")
class UserAutoMigration: AutoMigrationSpec { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment