--- project-total-assigned

alter table projects add total_assigned_tickets integer;

update projects set total_assigned_tickets = (
    select count(id) from tickets
    where 
        tickets.project_id = projects.id
        and tickets.[open] = 1
        and tickets.assignee_id is not null
);
