Modifying Database Fields in Development
As you develop an application, you might need to add fields to your database. This is a normal process of iterative development: you get an idea for a new feature, or it’s suggested to you, and that feature requires additional data in the database. New fields added to service.xml
are not automatically added to the database. To add the fields, you must do one of two things:
-
Write an upgrade process to modify the tables and preserve the data, or
-
Run the
cleanServiceBuilder
Gradle task (also supported on Maven and Ant), which drops your tables so they get re-created the next time your app is deployed.
Use the first option if you have a released application and you must preserve user data. Use the second option if you’re adding new columns during development.