-- Add title column for honorifics/salutations (Dr., Tante, Frau, etc.)
ALTER TABLE persons ADD COLUMN title VARCHAR(50);

-- Add person_type column to distinguish persons from institutions/groups.
-- SKIP is intentionally omitted: it exists in the Java enum for parse-time
-- filtering but must never be persisted. The CHECK constraint enforces this.
ALTER TABLE persons ADD COLUMN person_type VARCHAR(20) NOT NULL DEFAULT 'PERSON';
ALTER TABLE persons ADD CONSTRAINT chk_person_type
    CHECK (person_type IN ('PERSON', 'INSTITUTION', 'GROUP', 'UNKNOWN'));

-- Make first_name nullable for non-person entities (institutions, groups)
ALTER TABLE persons ALTER COLUMN first_name DROP NOT NULL;
