小编dio*_*jme的帖子

Room Database Migration无法正确处理ALTER TABLE迁移

Java.lang.IllegalStateException

迁移没有正确处理用户(therealandroid.github.com.roomcore.java.User).

预期:

TableInfo {name ='user',columns = {name = Column {name ='name',type ='TEXT',notNull = false,primaryKeyPosition = 0},age = Column {name ='age',type ='INTEGER ',notNull = true,primaryKeyPosition = 0},id = Column {name ='id',type ='INTEGER',notNull = true,primaryKeyPosition = 1}},foreignKeys = []}找到:

发现

TableInfo {name ='user',columns = {name = Column {name ='name',type ='TEXT',notNull = false,primaryKeyPosition = 0},id = Column {name ='id',type ='INTEGER ',notNull = true,primaryKeyPosition = 1},age = Column {name ='age',type ='INTEGER',notNull = false,primaryKeyPosition = 0}},foreignKeys = []}

我正在尝试执行一个简单的迁移,我有一个被调用的类User,它有两列ID (primary key) …

sqlite android android-room

26
推荐指数
5
解决办法
1万
查看次数

标签 统计

android ×1

android-room ×1

sqlite ×1