click to copycreate table tasks (
id text primary key,
title text not null,
column_name text not null default 'Pending',
priority text default 'med',
description text default '',
done boolean default false,
archived boolean default false,
archive_project text default 'Uncategorized',
collaborators jsonb default '[]'::jsonb,
attachments jsonb default '[]'::jsonb,
subtasks jsonb default '[]'::jsonb,
progress int default 0,
position float default 0,
deadline_start timestamptz,
deadline_end timestamptz,
activity jsonb default '[]'::jsonb,
created_at timestamptz default now()
);
alter publication supabase_realtime add table tasks;
create policy "Public access" on tasks for all using (true) with check (true);
alter table tasks enable row level security;
insert into storage.buckets (id,name,public) values ('task-files','task-files',true) on conflict do nothing;
create policy "Public storage" on storage.objects for all using (bucket_id='task-files') with check (bucket_id='task-files');