Last active
February 7, 2022 12:01
-
-
Save Farhandroid/d8a235cbe4023e5ecd8ae557d40d1002 to your computer and use it in GitHub Desktop.
Rename Column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Database( | |
entities = [User::class], | |
version = 3, | |
autoMigrations = [ | |
AutoMigration( | |
from = 2, to = 3, | |
spec = UserDatabase.RenameFromUserAddressToAddress::class | |
), | |
], | |
exportSchema = true | |
) | |
abstract class UserDatabase : RoomDatabase() { | |
@RenameColumn(tableName = "users", fromColumnName = "user_address", toColumnName = "address") | |
class RenameFromUserAddressToAddress : AutoMigrationSpec | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment