ALTER TABLE locations_wall_outlets
    ADD COLUMN IF NOT EXISTS cross_field_port_id INTEGER
    REFERENCES locations_cross_field_ports(id) ON DELETE SET NULL;

CREATE UNIQUE INDEX IF NOT EXISTS idx_wall_outlet_cross_field_port_active
    ON locations_wall_outlets(cross_field_port_id)
    WHERE cross_field_port_id IS NOT NULL AND deleted_at IS NULL;
