Bug creating unique indices

I have noticed that using postgres are creating the scripts in an erroneous way

-- unique indexes

create unique index IDX_EMPCMD_UNQ on EMP_COMANDO (NOM_COMANDO, TENANT_ID) where DELETE_TS is null ^

Regards,

Nelson F.

Hi, could you briefly describe what is wrong with the script?

Sorry @artamonov, forget to place the rest of the script. What happens is that my column is not called “DELETE_TS” its name is “FH_ELIMINADO”, that is; is taking by default “DELETE_TS” and not the name that is actually defined in the entity.

create table MDSF_CMDCANTIDAD (
    ID serial,
    FH_CREACION timestamp,
    CREADO_POR varchar(50),
    FH_MODIFICADO timestamp,
    MODIFICADO_POR varchar(50),
    FH_ELIMINADO timestamp,
    ELIMINADO_POR varchar(50),
    VERSION integer not null,
    TENANT_ID varchar(20),
    --
    NOM_CANTIDAD varchar(30) not null,
    --
    primary key (ID)
)^

-- unique indexes

create unique index IDX_MDSF_CMDCANTIDAD_UNQ on MDSF_CMDCANTIDAD (NOM_CANTIDAD, TENANT_ID) where DELETE_TS is null ^

Nelson F.

Greetings CUBA team, this is a bug or not?

Hi Nelson,

Yes, it’s a bug: https://youtrack.cuba-platform.com/issue/STUDIO-4689. We’ll try to fix it in one of the next 6.9 updates.

Thank you for reporting the issue!