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 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.