I have table _house with field 'soft_delete' default is 0.
Then I have a View to check undeleted entries, hence I have
CREATE VIEW house AS
SELECT * FROM _house where soft_delete = 0;
But the problem now is that everytime I modify table _house, I'll need to re-update my view so that is not broken.
So each time after modify table _house, I execute
ALTER VIEW house AS
SELECT * FROM _house where soft_delete = 0;
I wanted to find an easier way to execute above alter script, so I tried to create a procedure/function with 'alter view' inside, but mysql seems to prohibit me doing that.
Question :
- Any other solution to simplify this 'redundant' actions ?