Room version used:- 1.1.1-rc1
I had an existing database which is implemented by ormlite. I am trying to migrate to Room with the existing sqlite file generated by ormlite.
When we used long datatype for table column in ormlite it gets coverted to BIGINT in sqlite. so the schema created contains column which is of type BIGINT which is unknown type for room.When I try to upgrade the app with Room I am getting migration exception.
java.lang.IllegalStateException: Migration didn't properly
Process: com.sample.playground, PID: 5587
java.lang.IllegalStateException: Migration didn't properly handle SampleReports(com.sample.playground.model.SampleReport
Expected:
TableInfo{name='SampleReports', columns={timeslot=Column{name='timeslot', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, environment=Column{name='environment', type='TEXT', affinity='2', notNull=true, primaryKeyPosition=0}, timestamp=Column{name='timestamp', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, trigger=Column{name='trigger', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, imeisvSvn=Column{name='imeisvSvn', type='TEXT', affinity='2', notNull=false, primaryKeyPosition=0}, _id=Column{name='_id', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=1}}, foreignKeys=[], indices=[]}
Found:
TableInfo{name='SampleReports', columns={environment=Column{name='environment', type='TEXT', affinity='2', notNull=true, primaryKeyPosition=0}, timeslot=Column{name='timeslot', type='BIGINT', affinity='3', notNull=true, primaryKeyPosition=0}, trigger=Column{name='trigger', type='INTEGER', affinity='3', notNull=true, primaryKeyPosition=0}, timestamp=Column{name='timestamp', type='BIGINT', affinity='3', notNull=true, primaryKeyPosition=0}, _id=Column{name='_id', type='INTEGER', affinity='3', notNull=false, primaryKeyPosition=1}}, foreignKeys=[], indices=[]}
at com.sample.playground.model.SampleReport.SampleReportRoomDbHelper_Impl$1.validateMigration(SampleReportRoomDbHelper_Impl.java:77)
at android.arch.persistence.room.RoomOpenHelper.onUpgrade(RoomOpenHelper.java:87)
at android.arch.persistence.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onUpgrade(FrameworkSQLiteOpenHelper.java:133)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:256)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
at android.arch.persistence.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:96)
at android.arch.persistence.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:54)
at android.arch.persistence.room.RoomDatabase.query(RoomDatabase.java:233)
at com.sample.playground.model.SampleReportDao_Impl.getReports(SampleReportDao_Impl.java:300)
Tried with TypeConverter using BigInteger still it didn't worked.