-- Parcours des chats libres suivis par l'association.
ALTER TABLE animals ADD COLUMN free_cat_site_name TEXT;
ALTER TABLE animals ADD COLUMN free_cat_city TEXT;
ALTER TABLE animals ADD COLUMN free_cat_address TEXT;
ALTER TABLE animals ADD COLUMN free_cat_caretaker_contact_id INTEGER REFERENCES directory_contacts(id) ON DELETE SET NULL;
ALTER TABLE animals ADD COLUMN free_cat_captured_at TEXT;
ALTER TABLE animals ADD COLUMN free_cat_released_at TEXT;
ALTER TABLE animals ADD COLUMN free_cat_tracking_status TEXT NOT NULL DEFAULT 'present'
  CHECK(free_cat_tracking_status IN ('present','missing','moved','deceased'));

CREATE INDEX IF NOT EXISTS idx_animals_free_cat_site ON animals(free_cat_site_name, free_cat_city);
CREATE INDEX IF NOT EXISTS idx_animals_free_cat_caretaker ON animals(free_cat_caretaker_contact_id);
