ALTER TABLE projects
    ADD COLUMN archived_at timestamptz;

ALTER TABLE projects
    ADD CONSTRAINT projects_archived_status_check
    CHECK (archived_at IS NULL OR status = 'ENDED');

CREATE INDEX projects_active_name_idx
    ON projects (name, id)
    WHERE archived_at IS NULL;
