-
-
Save florina-muntenescu/39f4ff6f6cb6f68fe14078f23d60f8b4 to your computer and use it in GitHub Desktop.
This file contains 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
/* Copyright 2020 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
@Database( | |
version = 2, | |
entities = [ GoodDoggos.class ], | |
autoMigrations = [ | |
AutoMigration ( | |
from = 1, | |
to = 2, | |
spec = DoggosDatabase.DoggosAutoMigration::class | |
) | |
] | |
) | |
abstract class DoggosDatabase : RoomDatabase { | |
@RenameTable(fromTableName = "Doggos", toTableName = "GoodDoggos") | |
class DoggosAutoMigration: AutoMigrationSpec { } | |
} |
I was so confused at first, wondering why it didn't work I thought we were over this Java stuff lol
In Kotlin you would write it like this I think:
@Database(
version = 2,
entities = [
MyEntity::class,
],
autoMigrations = [
AutoMigration(from = 1, to = 2)
],
exportSchema = true
)
abstract class ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DoggosDatabase .java