During the course of development, you’re likely to 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. It’s important to note, then, that 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. See the Maven DB Support Plugin reference article for instructions on how to run this command from a Maven project.
Use the first option when you have a released application and you must preserve your users’ data. Use the second option when you’re in the middle of development and you’re adding new columns during that process.