alter table public.operations_stop_aliases
add column if not exists source text not null default 'user';

update public.operations_stop_aliases
set source = 'user'
where source is null or btrim(source) = '';

alter table public.operations_stop_aliases
drop constraint if exists operations_stop_aliases_source_check;

alter table public.operations_stop_aliases
add constraint operations_stop_aliases_source_check
check (source in ('user', 'ai'));
