How to update database table structure after the app was published?

Hi,

When there is a need to update database table structure after the App was published, what is the best practice? What come to my mind is to write some sql statements in main.lua to update the db and populate data from there if any. How about creating some reserve field or table for future use?

I hope to get good advices and suggestion from you guys here.

Thanks,

So Lin

Anyone?

You can first check if current db has a specific field (like version number) and if it doesn’t exist then copy it and add new data including version number.  

it’s to abstract to give a suggestion. but, in my opinion, if you need to change the structure of the database, most likely you will need to  change your app too, to accomplish those new fields. even so you can in advance prepare your code to check number of fields, and in your app populate data according to those number of fields. but like i said it’s to abstract to give any suggestions.

Anyone?

You can first check if current db has a specific field (like version number) and if it doesn’t exist then copy it and add new data including version number.  

it’s to abstract to give a suggestion. but, in my opinion, if you need to change the structure of the database, most likely you will need to  change your app too, to accomplish those new fields. even so you can in advance prepare your code to check number of fields, and in your app populate data according to those number of fields. but like i said it’s to abstract to give any suggestions.