begin;

alter table public.chat_sessions
  add column if not exists chart_profile_id text,
  add column if not exists chart_profile_name text,
  add column if not exists chart_profile_role text
    check (chart_profile_role in ('self', 'other'));

grant insert (chart_profile_id, chart_profile_name, chart_profile_role)
  on table public.chat_sessions to authenticated;
grant update (chart_profile_id, chart_profile_name, chart_profile_role)
  on table public.chat_sessions to authenticated;

commit;
