-- IGNORE / junk bucket for the face recognition feature.
--
-- An "Ignored" person is the destination for strangers, faces the user
-- doesn't want tagged, and false detections. It looks like any other
-- person row (so face_detections.person_id stays a clean foreign key)
-- but `is_ignored=1` flags it for special UI treatment:
--   - hidden from the persons list by default
--   - excluded from `find_persons_by_names_ci` so a tag-name match
--     can never auto-bind a real face to the ignore bucket
--   - cluster-suggest already filters by `person_id IS NULL`, so faces
--     bound to an ignored person are naturally excluded from future
--     re-clustering
--
-- Partial index because the WHERE-clause is small (typically 1 row),
-- and we only ever query for `is_ignored = 1` to find the bucket.

ALTER TABLE persons ADD COLUMN is_ignored BOOLEAN NOT NULL DEFAULT 0;

CREATE INDEX idx_persons_is_ignored
    ON persons(is_ignored) WHERE is_ignored = 1;
