-- Reverse Phase L. Best-effort: any rows with role values outside the
-- original enum will fail the restored CHECK constraint and the migration
-- will abort — that is intentional, since blindly losing data is worse.

ALTER TABLE paliad.users
    DROP COLUMN IF EXISTS dezernat;

ALTER TABLE paliad.users
    DROP CONSTRAINT IF EXISTS users_role_check;

ALTER TABLE paliad.users
    ADD CONSTRAINT users_role_check CHECK (role IN (
        'partner', 'associate', 'pa', 'admin'
    ));
