Remove archive/restore from the session menu and drop archived=1 listing. PATCH still accepts archived_at from old bundles then ignores it. A forward migration clears archived_at without bumping updated_at. Delete stays unchanged.
21 lines
484 B
PL/PgSQL
21 lines
484 B
PL/PgSQL
-- 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;
|