sql - Hidden condition to all possible queries -
i'd hide selecting objects not rewriting sql queries more simple way.
so, i'd add rule (or else) database particular table. e.g. if delete user website execute next:
update user_common set is_deleted='t' user_id=1234
and there no need rewrite existing queries users, condition hidden:
select first_name, second_name user_common coins>200
the select above executed hidden condition, e.g.:
select first_name, second_name user_common coins>200 , is_deleted!='t'
how make working?
you can accomplish want view.
create view v_table select uc.* user_common uc is_deleted <> 't';
the key references table need change view. 1 way renaming table , creating view same name:
alter table user_common base_user_common; create view user_common select uc.* user_common uc is_deleted <> 't';
Comments
Post a Comment