Seems one cannot not add custom index at entity level so Studio drove me to database scripts. I therefore created some custom indexes like the one defined below in database scripts window of Studio 6.10.
create index IDX_BUSY_COUNTERPART_LOWER_INTERNAL_CODE on BUSY_COUNTERPART (lower(INTERNAL_CODE));
But now, when I generate db scripts, Studio generates drop scripts for these indexes. I excluded the scripts, but this should not be necessary.
I am wondering if there is a more “studio compliant” way of setting up custom indexes.
The studio removes indexes that begin with IDX_${project namespace}, in your case it is IDX_BUSY. If you name it differently from this pattern, the studio will not delete them.
For example:
I_BUSY_COUNTERPART_LOWER_INTERNAL_CODE
IDX_CUSTOM_COUNTERPART_LOWER_INTERNAL_CODE
MY_IDX_BUSY_COUNTERPART_LOWER_INTERNAL_CODE
IDX_NONSTUDIO_COUNTERPART_LOWER_INTERNAL_CODE
etc…
Thanks @zlatoverov, good to know, it would be worth being mentioned in documentation.
Another question. I did recreate the update script (“new update script”) creating indexes with prefix MYIDX, than I applied it successfully and saw that no more drop statements are then generated.
However, I then switch to another dev database, and generate db scripts. Studio tells me that the update script has not been executed, which is good.
But If I click “continue” instead of “update database”, the custom update script is lost. More precisely it goes into “to be deleted” state (below)
Why do I click “continue” ? Because our dev & hom databases do not evolve the same way so it’s more safe to regenerate scripts from scratch to be sure one have a proper db model (we solved in the past lots of issues regarding handling of several databases with that).
Is there away to register this script as full part of the model and not a one shot one ?
Thanks for the report.
Unfortunately, this is not possible now, but in the future, we plan to support the generation of update scripts for several databases.