update public.projects
set name = 'Untitled Project ' || left(id::text, 8)
where length(trim(coalesce(name, ''))) = 0;

alter table public.projects
  drop constraint if exists projects_name_not_blank;

alter table public.projects
  add constraint projects_name_not_blank
  check (length(trim(name)) > 0);
