-- BUG-991: put archived sessions back on the live list. -- Keep archived_at for a later drop (AGENTS.md ยง7.6). Do not bump updated_at -- (BUG-988). Idempotent: a second run matches 0 rows. begin; do $migration$ begin if current_user <> 'schema_owner' then raise exception 'retire_chat_session_archive_requires_schema_owner' using errcode = '42501'; end if; end $migration$; update public.chat_sessions set archived_at = null where archived_at is not null; commit;