V1
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
-- =====================================================================
|
||||
-- GameDev Tracker — Migration v3
|
||||
-- À exécuter UNE FOIS dans : Supabase > SQL Editor > New query
|
||||
-- (après migration_v2.sql)
|
||||
--
|
||||
-- Contenu :
|
||||
-- • Temps « libre » dans la feuille de temps (réunion, etc.) :
|
||||
-- une entrée peut ne pas être liée à une tâche du Kanban.
|
||||
-- =====================================================================
|
||||
|
||||
-- La tâche devient optionnelle ; un libellé libre la remplace si absente.
|
||||
alter table public.time_logs alter column task_id drop not null;
|
||||
alter table public.time_logs add column if not exists label text;
|
||||
|
||||
-- Rattachement direct au projet (pour retrouver aussi les entrées sans tâche).
|
||||
alter table public.time_logs
|
||||
add column if not exists project_id uuid references public.projects(id) on delete cascade;
|
||||
|
||||
-- Backfill : les entrées existantes héritent du projet de leur tâche.
|
||||
update public.time_logs tl
|
||||
set project_id = t.project_id
|
||||
from public.tasks t
|
||||
where tl.task_id = t.id and tl.project_id is null;
|
||||
|
||||
create index if not exists idx_time_logs_project on public.time_logs(project_id);
|
||||
Reference in New Issue
Block a user