Problem with generated DB scripts

I created an entity “Material” inherited from StandardEntity, it has three own attributes:

  1. matName, string 256
  2. matFile, association 1:1 to FileDescriptor with on delete CASCADE option
  3. matActivities, association n:n to my another entity with on delete CASCADE option

And when I click to a “Generate DB scripts” button I get the createMaterial.sql:

    DELETE_TS timestamp,
    DELETED_BY varchar(50),
    MAT_NAME varchar(255),
    MAT_FILE_ID uuid,

There is no id, create_ts, created_by etc. not even speaking about closing parenthesis.
I tried to change order of my attributes.
I even downloaded and installed the latest version of Cuba Studio server 6.8.5 but got the same result.
I don’t think that it is my fault.
Of course I’ll finish the script myself now but please correct the error.

Hello, @evgenypopov

Could you share sample project with your data model to investigate the problem?


I could not reproduce the error on a new 2-entity project. The update scripts generated by CUBA Studio was normal. I don’t know why it happens in our project and can’t send you our project because of large size and copyright.

Unfortunately we cannot reproduce the problem.

Could you check Studio logs for some related messages? They are located here: <home_dir>/.haulmont/studio/logs/studio.log


Hi again
I’ve got a similar error in generated DB script right now when creating a new entity. The create table script is incomplete and system columns are absent. The Studio log shows no errors.
The new entity was inherited from BaseUUIDEntity.
We have 90 entities in our project now - can it have any influence?


Are you still using the 6.8.5 version of CUBA Studio? And could you share a script that is generated by Studio?

It’s hard to say, whether amount of entities affects on Studio, or not, we should investigate the problem to answer on this question.


Yes, CUBA Studio version is 6.8.5
That’s generated script:

    AP_SOMEENTITY_CATEGORY varchar(50) not null,
    AP_SOMEENTITY_TYPE varchar(50),
    AP_ACTIVITY_ID uuid not null,
    AP_IS_ENABLED boolean,

I had to finish it myself and the table created successfully.

Unfortunately, we cannot reproduce the problem.

Could you share full scheme of entities that are used while creating this problem part?

Also, please run Studio with -nogui flag:

  • ./studio -nogui - Linux
  • studio.bat -nogui - Windows

and share full log that will be outputted while creating this part of scheme and generating SQL scripts.

Today’s Studio log attached. There are fresh errors of creating a new entity table. If it’s not enough, I’ll send you our full scheme of entities.
studio.log (32.2 KB)

Please share log that will contain messages about creating your entities and generating DB scripts.

And also please share scheme of entities for which DB scripts are not generated correctly.


That’s the result of “Generate DB scripts” on any new entity on my workplace. All my attributes are included in the sql script.
The Studio log contains nothing new nor interesting.

studio.log (35.5 KB)

Unfortunately, there is nothing that can help us to solve the problem.

Does Studio generate wrong script for any new entity or there is some special case? Please clarify what RDBMS do you use?