是指什么?也许Google在说我们需要使用外部工具打开SQLite文件并编辑Pragma User_version值?这是必须使房间迁移工作的强制性吗?
是什么意思?
[*如果将[exportSchema
]设置为false)]。
false
]表示不可能自动迁移。]作为软件包的一部分存储时,该架构允许空间查看以前的模式,从而生成代码以更改(迁移)架构(有限制)。
true
还应注意,该架构在编译时间进行哈希,并存储在一个名为[
ROOM_MASTER_TABLE]的表中的实际数据库中。 [版本号],这是在编译时传递/生成的。它用于将实际数据库中的[
USER_Version]作为标头的一部分进行比较(标题是文件的第1个字节,[user_version]为4个字节,并且作为整数值访问)。 如果存在不匹配,则数据库中的值应/应低于编译的版本编号,用于确定要进行的迁移。 If in the case of [*exportSchema*] being false (i.e. no Auto Migration) AND falbackToDestructiveMigration has been specified AND there are no migrations to cover the migration then the database is deleted and will be created according to the current schema UNLESS createFromAsset (File) indicates that the database should be copied from the asset/file after which comparison with the expected current schema and version number are undertaken, any根据规则/代码处理差异。
请注意评论询问为什么您希望您编辑/更改资产/文件。例如,如果您添加了一个表,则资产/文件将需要包括新表,否则资产/文件将不正确。同样,版本(资产/文件中的user_version)。
[*是*]资产/文件必须遵守房间期望的架构明智(表/列等),并且[
user_version
]很重要。