Uberjar - database question from newbies

Hi,
new to all this, and very excited by the multitude of features and available options.
I have a question regarding uberjar deployment. I am staging a docker environment and deployed successfully using uberjar approach. My question now is : if I need to publish new features, I will need ti rebuild my uberjar. That’s ok, I understand that. What if I modified the database structure ? Will they be applied automagically to the production db by the uberjar ? Do i need to apply the scripts manually to the database ?
What happens to the existing data ?

Thank you
Andrea

1 Like

Hi,

generally, it heavily depends on how you configure it. But it seems that you want it to be automatically executed when the app is deployed, right? This is in fact a pretty common case.

You can read about this approach here: Execution of Database Scripts by Server - CUBA Platform. Developer’s Manual

cuba.automaticDatabaseUpdate = true

will check for new update scripts that have not been applied to the database since the last time and will apply them.

These update scripts get created via CUBA studio or you can do it on your own. However, sometimes you have to adjust them, especially when you have to make sure that certain data get default values etc.

I think the whole section about “Working with Databases” might be interesting for you: Working with Databases - CUBA Platform. Developer’s Manual

Bye
Mario

3 Likes

Ok, thank you Mario.
(BTW great blog).