-- schema version 1 to 2

DROP VIEW v_area_commitment;

ALTER TABLE delivery_part DROP COLUMN weighing_reason;

ALTER TABLE delivery_part ADD COLUMN weighing_reason TEXT CHECK(NOT (manual_weighing = FALSE AND weighing_reason IS NOT NULL));
