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: https://doc.cuba-platform.com/manual-6.8/db_update_in_prod_by_server.html
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: https://doc.cuba-platform.com/manual-6.8/databases.html