Previously, while add an addon to main project, the DB scripts of the addon will be copied to new project.
Recently, we found that while add an addon to main project, the DB scripts of the addon will not be copied, instead, cuba studio generates scripts for addon in the main project.
This seems not always right, for example, I have one addon, it contains scripts that cuba studio cannot generate, like “create or replate view my_view as select xxxxx”, or “CREATE EXTENSION IF NOT EXISTS “uuid-ossp”;”, or some updates sql which update live database for upgrade.
For the case when use an addon which not familiar with such details, or update an addon with special DB changes, the main project cannot get the correct DB scripts generated.
Is there something changed in studio? How to handle the case mentioned above?
Hi,
I’ve checked with Studio 13.1 and CUBA 7.2.2, and Postgres DB in the add-on and it works as expected.
If my add-on uses Postgres DB, and main project uses other (HSQL) database - then project generates missing database scripts for the add-on for HSQL.
If switch project to use Postgres for its main data store - then project transparently uses inherited addon’s DB scripts, including custom SQL that I put there:
Also could you make sure that artifact with database scripts (addonname-core-0.1-SNAPSHOT-db.zip) was successfully published?