1

We are migrating from AppVersion 2.3 to AppVersion 2.4. Till 2.3 we had used GreenDao. In 2.4 we have used Room. We have written migration code for DB changes in Room. Now problem is that migration code is executing multiple times.

Nagesh Jatagond
  • 344
  • 2
  • 13
  • it will happen only if your migration is not successful due to any issues. The Migration code will execute every time unless it succeeds. – Gautam Oct 05 '18 at 07:42
  • Have you faced any issues like this before. Because we are unable to identify what is causing this issue. We have written all migrations. – Nagesh Jatagond Oct 05 '18 at 08:00
  • 1
    yes, I faced a similar situation. I was using room and migration was not getting successful but there were no errors. Even the test case was showing migration was successful but it wasn't. I asked a similar question a year back. You can look here https://stackoverflow.com/questions/46687160/room-migration-alter-table-not-adding-new-column-migrate-getting-called-again – Gautam Oct 05 '18 at 08:06
  • Thanks @Gautam. Whatever is said in that post we have already taken care that. We have it migration code also and even in model class. – Nagesh Jatagond Oct 05 '18 at 09:53
  • 1
    In that post, only part of the problem was solved but what actually solved for me as we were having two entities having the same model/pojo & during migration I was only updating my single entity. Hope it gives you an idea what else can be a problem.Might not be exactly same. – Gautam Oct 05 '18 at 14:08

0 Answers0