Exception when executing SQL: -- update SEC_USER set CLIENT_ID = <default_value> ;

Error appears:

Execution failed for task ‘:app-core:updateDb’.

Exception when executing SQL:
– update SEC_USER set CLIENT_ID = <default_value> ;
– alter table SEC_USER alter column CLIENT_ID set not null ;
alter table SEC_USER add column CLIENT_ID varchar(36) not null ;

Problem with inheritance from system entity USER when updating DB.
Data model is like that:
CLIENT for company entity.
LOGIST for an employee, child from USER.

So what is the error message?
I don’t see it in your post.

So I have COMPANY entity, then DRIVER (inherits from USER).
DRIVER associated with Company – it’s OK.
When I try create composition link for drivers in COMPANY the following error appears:

Execution failed for task ‘:app-core:createDb’.

Exception when executing SQL:
alter table SEC_USER add column COMPANY_ID varchar(36) not null

And message in event log:
Mandatory reference column COMPANY_ID is going to be added into the table SEC_USER.
This change may cause exception on database update if table contains data.
To prevent this to happen you need to add not mandatory column first, then update existing data and set column mandatory.
Use commented statements as template, replace default_value with actual reference id. Do not forget to get rid of initial statement.

OK, you haven’t found the actual error message. But the reason most probably is the following:

When you add notnull column to existing table, AND this table already contains some rows - the SQL statement will fail.

The Studio tried to give you a hint with the message in the event log and commented SQL above.

You can do the following:

  1. Remove “not null” from the update script. Make it just:

alter table SEC_USER add column COMPANY_ID varchar(36)

  1. Or uncomment one of SQL lines and assign some default CLIENT_ID:

update SEC_USER set CLIENT_ID = ‘WRITE-DEFAULT-ID-HERE’ ;
alter table SEC_USER add column CLIENT_ID varchar(36) not null ;