-- Add task_activity_logs table to track task events (assign/started/completed/reassigned)

create table if not exists task_activity_logs (
  id uuid primary key default gen_random_uuid(),
  task_id uuid not null references tasks(id) on delete cascade,
  actor_id uuid references profiles(id),
  action_type text not null,
  meta jsonb,
  created_at timestamptz not null default now()
);

create index if not exists idx_task_activity_logs_task_id on task_activity_logs(task_id);
