The scenario is the following:
- Created a simple project with
global
andcore
modules only, with 3 entities (the same from thesample-booking
project) - Generated DB scripts for HSQL
- Created app component descriptor and installed locally
Then I created another empty project to host the previous component:
- Added the component using the Project Properties dialog
- Run the
Create Database
task
The scripts for the component were not executed:
17:37:11: Executing task 'createDb'...
> Task :booking-core:assembleDbScripts
> Task :booking-core:createDb
Using database URL: jdbc:hsqldb:hsql://localhost:9010/booking, user: sa
Executing SQL: drop schema public cascade;
Using database URL: jdbc:hsqldb:hsql://localhost:9010/booking, user: sa
Executing SQL script: /Users/paolof/Developer/cuba/7/booking/modules/core/build/db/10-cuba/init/hsql/create-db.sql
BUILD SUCCESSFUL in 0s
2 actionable tasks: 2 executed
17:37:12: Task execution finished 'createDb'.
Then I tried deleting the published component in my m2
directory, rebuild and reinstall it, close and restart CUBA Studio, but with the same outcome.
Then I deleted the IDE caches, cleaned, undeployed, restarted the IDE again, compiled the project, and this time the Create Database
worked as expected:
17:37:11: Executing task 'createDb'...
> Task :booking-core:assembleDbScripts
> Task :booking-core:createDb
Using database URL: jdbc:hsqldb:hsql://localhost:9010/booking, user: sa
Executing SQL: drop schema public cascade;
Using database URL: jdbc:hsqldb:hsql://localhost:9010/booking, user: sa
Executing SQL script: /Users/paolof/Developer/cuba/7/booking/modules/core/build/db/10-cuba/init/hsql/create-db.sql
Executing SQL script: /Users/paolof/Developer/cuba/7/booking/modules/core/build/db/50-booking-common/init/hsql/10.create-db.sql
Executing SQL script: /Users/paolof/Developer/cuba/7/booking/modules/core/build/db/50-booking-common/init/hsql/20.create-db.sql
Executing SQL script: /Users/paolof/Developer/cuba/7/booking/modules/core/build/db/50-booking-common/init/hsql/30.create-db.sql
BUILD SUCCESSFUL in 0s
2 actionable tasks: 2 executed
17:37:12: Task execution finished 'createDb'.
I’ve never had this kind of quirks before when using the standalone Studio, and I hope this won’t be the norm going forward…