在数据库类中创建房间数据库时,我注意到exportSchema关键字
@Database(entities = [SleepNight::class], version = 1, exportSchema = false)
abstract class MyDB : RoomDatabase() {
}
我不明白为什么exportSchema需要是假的还是真的?它对数据库有什么影响?
发布于 2020-11-11 15:37:34
如下面的链接所示,当设置了变量-> room.schemaLocation="your schema location path“参数时,使用exportSchema将数据库模式导出到给定的文件夹。默认为true。
https://developer.android.com/reference/androidx/room/Database#exportSchema()
https://stackoverflow.com/questions/64781751
复制相似问题