Closed nicolas-sitylb closed 1 year ago
A delta is required with this code :
ALTER TABLE qwat_od.pipe DROP CONSTRAINT pipe_year_check ;
ALTER TABLE qwat_od.pipe ADD CONSTRAINT pipe_year_check CHECK (year IS NULL OR year >= 1800 AND (year <= EXTRACT(YEAR FROM NOW()) OR fk_status = 1306 AND year - 50 <= EXTRACT(YEAR FROM NOW())));
https://stackoverflow.com/questions/13244889/how-to-alter-constraint
Hmm pum check
should have failed without the delta, no ?
To my knowledge, pum check the existence but not the syntax of constraints.
See :
https://github.com/opengisch/pum/blob/master/pum/core/checker.py#L178
Ok, opened an issue here : https://github.com/opengisch/pum/issues/103
IMO worth looking into as there may be inconsistencies in constraints btw the datamodel and an upgraded datamodel, which could be serious in terms of data integrity