In the database i have one base table, named Organization
that most of tables has foreign key to that. assume this below ERD:
As you seen Organization
table has a column named is_enabled
. now if i want to disable the Organization
, i should set is_enabled
to 1
. it's very simple, but the problem is that if i want to prevent all other procedures and functions to use the disabled Organization
, i should define trigger
on all of the tables that has foreign key reference to Organization
table, and this way is bad.
Is there another way to prevent all objects to use disabled Organization
s?
also for insert or update the data, for example if i have a Organization
with org1 title, and if it has a Department
with dep1 name, after i disabled org1, i couldn't update dep1 name, and this problems exists for all tables that has reference to Organization
.