MySQL Problem when updating cuba platform

Hi,

I am using cuba platform with mariadb (but mysql jdbc driver which can be selected).

When I upgraded to the latest cuba platform (7.2.1) I got some update scripts to remove the SYS_TENANT_ID_NN from sec_group, sec_role and sec_user. But these scripts didn’t remove the trigger and didn’t change the index that was on these tables.

I think this is some kind of bug and so I would like to give the details to you. (Maybe I missed something and you could also tell me what my mistake was so that I ran into this situation).

My solution for this problem:
Instead of using the manual provided update scripts, I used my own script and applied it manually / removed the generated scripts:

– Remove SYS_TENANT_ID_NN from sec_group
drop trigger SEC_GROUP_SYS_TENANT_ID_NN_AND_DELETE_TS_NN_UPDATE_TRIGGER;
drop trigger SEC_GROUP_SYS_TENANT_ID_NN_INSERT_TRIGGER;
alter table sec_group drop key IDX_SEC_GROUP_UNIQ_NAME;

alter table sec_group
add constraint IDX_SEC_GROUP_UNIQ_NAME
unique (NAME, DELETE_TS_NN);

alter table sec_group
drop column SYS_TENANT_ID_NN;

– Remove SYS_TENANT_ID_NN from sec_role
drop trigger SEC_ROLE_SYS_TENANT_ID_NN_AND_DELETE_TS_NN_UPDATE_TRIGGER;
drop trigger SEC_ROLE_SYS_TENANT_ID_NN_INSERT_TRIGGER;

alter table sec_role drop key IDX_SEC_ROLE_UNIQ_NAME;

alter table sec_role
add constraint IDX_SEC_ROLE_UNIQ_NAME
unique (NAME, DELETE_TS_NN);

alter table sec_role
drop column SYS_TENANT_ID_NN;

– Remove SYS_TENANT_ID_NN from sec_user
drop trigger SEC_USER_SYS_TENANT_ID_NN_AND_DELETE_TS_NN_UPDATE_TRIGGER;
drop trigger SEC_USER_SYS_TENANT_ID_NN_INSERT_TRIGGER;

alter table sec_user drop key IDX_SEC_USER_UNIQ_LOGIN;

alter table sec_user
add constraint IDX_SEC_USER_UNIQ_LOGIN
unique (LOGIN_LC, DELETE_TS_NN);

alter table sec_user
drop column SYS_TENANT_ID_NN;

Hi,
This is a known problem: https://youtrack.cuba-platform.com/issue/STUDIO-8020

It will be fixed in the next Studio bugfix release 13.1.