Delete Rule in not working in entities which are belongs from different schema

Hi Everyone,

In my web application initially there was only one DB schema Main but right now I need one more DB schema which responsible for application transaction data But Users & RichWidgets are still in Main schema. So while publishing I am getting below warning:

"Database Integrity Suggestion
Constraint for 'XXXXXXXXX.User_Id' was not created because it references a entity from a module in a different database schema. The delete rule should be changed to ignore."


As per my understanding plateform not allowing to create protected delete rule within entities which belongs two different DB schema. I want to know why this is happening and what can be done to avoid this warning rather than changing delete rule to ignore.


Note: Both DB schema belongs to same physical database.


Regards

-SK-


Hi Shashikant,

By default Outsystems creates the Main database schema and all the systems component and meta information get stored in this database which you cannot change. Now you can create a new schema within the  same database and the application you create can go to either Main or New schema.

Now in your case you User entity exists in the Main schema and which is being used in entity in new schema as a foreign key . In such cases where you have foreign key relationship between different schema the Key Constraints are dropped in the background and there will no guaranteed integrity while using delete rules and hence you are seeing that warning.


Regards,

-PJ-

Pramod Jain wrote:

Hi Shashikant,

By default Outsystems creates the Main database schema and all the systems component and meta information get stored in this database which you cannot change. Now you can create a new schema within the  same database and the application you create can go to either Main or New schema.

Now in your case you User entity exists in the Main schema and which is being used in entity in new schema as a foreign key . In such cases where you have foreign key relationship between different schema the Key Constraints are dropped in the background and there will no guaranteed integrity while using delete rules and hence you are seeing that warning.


Regards,

-PJ-

Pramod Sir,

I just want to understand the reason to dropping constraints  in the background.


Regards

-SK-


Hi Shashi,

Its very simple that they both are in different schema and the rule applied in one entity in one schema cannot control the deletion of data in other entity presented in different schema and thus there is no sense keeping the delete rule to protect or delete here.

AFAIK its not something by outsystems but is enforced from db side.


Regards,

-PJ-