-- Revert mig 106 — drop 'madrid' from the office CHECK constraints.
--
-- Will fail if any users.office or partner_units.office row carries
-- 'madrid' — that's intentional (the down has no opinion on the data;
-- caller must clean up first or accept the failure).

SELECT set_config(
    'paliad.audit_reason',
    'mig 106 down: restore pre-madrid office CHECK on users + partner_units',
    true);

ALTER TABLE paliad.users
    DROP CONSTRAINT IF EXISTS users_office_check;
ALTER TABLE paliad.users
    ADD CONSTRAINT users_office_check
    CHECK (office IN (
        'munich', 'duesseldorf', 'hamburg',
        'amsterdam', 'london', 'paris', 'milan'
    ));

ALTER TABLE paliad.partner_units
    DROP CONSTRAINT IF EXISTS partner_units_office_check;
ALTER TABLE paliad.partner_units
    ADD CONSTRAINT partner_units_office_check
    CHECK (office IN (
        'munich', 'duesseldorf', 'hamburg',
        'amsterdam', 'london', 'paris', 'milan'
    ));
