最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

database - Room DB migration in Android Kotlin - Stack Overflow

programmeradmin5浏览0评论

In my android project I have two module say Module1 and Module2 and both have separate DB say DB1 and DB2, Now due to cross functionality in module I have to merge both module and so now only one DB is required, But this project is already live now how to manage DB migration while merging both DB into one.

In my android project I have two module say Module1 and Module2 and both have separate DB say DB1 and DB2, Now due to cross functionality in module I have to merge both module and so now only one DB is required, But this project is already live now how to manage DB migration while merging both DB into one.

Share Improve this question asked Mar 24 at 4:50 gourav anandgourav anand 232 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

1. create all 'DB2's tables in DB1.

2. Make one function (on the opening activity) to copy data from the DB2's tables into DB1 (which data you required to continue)

3. make sure this function should run one time only.

4. By the ext versions, ignore the DB2. And later on (after a while) you can remove the DB2.

发布评论

评论列表(0)

  1. 暂无评论