Because if you want to add YOUR custom constraints (beside the ones generated by the tools), the standard way of doing this is creating new file(s) next to the standard ones (10, 20, and 30) and numbering them like 21 to 29 (for example 21.create-db.sql).
So for example you could have the following files in the mysql directory: 10.create-db.sql
11.create-db.sql 20.create-db.sql
21.create-db.sql
30.create-db.sql
The bold ones are generated by the tools, and you should never edit them directly, but the others are under your complete control… Write whatever DML instructions you need (in standard SQL).
P.
PS: obviously they are executed in order when performing the first database initialisation, and I forgot to mention that this is all documented in the docs
First of all, updateScript command doesn’t do what you think. It creates empty sql script with specially generated date prefix.
cuba>update-script
? Script name (updateSomeTable) > updateSomeEntityAttribute
created modules/core/db/update/hsql/18/180917-1-updateSomeEntityAttribute.sql
Secondly, CLI doesn’t write any scripts for you now (and maybe won’t). So if you wan’t to make some changes in them, do it by your hands.
You can see command description using --help flag.
cuba>update-script --help
Creates new database update script
Usage: update-script