i have an ionic android mobile app which connects to a ruby on rails api server and this app uses postgresql as database server.
whenever i create a new feature i deploy both, the api and the new app to the app store and bump the respective versions of api and the app, which have their own version numbering sequence.
The api is deployed to the server but app's on users devices are not frequently updated so below 2 cases arise for me
Case 1 : New columns additions
Issue happens for a release when for e.g i have few new columns added to certain tables in db to capture additional info for which respective text fields have also been added to the app's UI.
Here users of the newer version of app will work as expected (send those 2 info to columns) but the older versions will not be sending those 2 field values
Case 2: Columns deleted
for instance i am re-architecting the app in a major way and have to normalized the database as it was inefficient earlier which even leads to breaking of tables etc or deletion of a couple of columns.
Here the older versions of app would simply crash or fail to work.
i feel every business app i build will have this same scenario to manage and it should be common issue to all
I am in the process of writing some custom logic where the app would check when connected to api server for a "update flag" and if the app's version is set to be force updated to make it work with api version then the app would be redirected to play/ app store.
i would like to know how everyone handle this problem and am i doing the right way.
Is there any rails plugin or library which already takes care of this particular problem or helps in doing so. i know there are lot of versioning gems available but they dont take care of this issue [force updating app]
Please guide