Loading articleโฆ
Loading 4weirdโฆ
Loading 4weirdโฆ
Loading articleโฆ
DocsMigration
Docs ยท remastery runbook
The Wave 1 Supabase migration creates the squad, kanban, time-tracking, invoicing, notification, and chat tables from remastery spec section 2 โ with Row Level Security and indexes. Run it in the Supabase SQL editor, in order, then prove it worked.
Before you run
The full DDL lives in the remastery spec (public/swarm/remastery/README.md, section 2). This page is the run order and the proof โ run each block in the Supabase SQL editor for the project that hosts the app, top to bottom.
Block A
Creates squad_projects (name, description, repository_url, target_game_slug) and the squad_project_members join table with lead / contributor / reviewer roles. Depends on public.squads and auth.users.
block A โ tables
2 tablesBlock B
Creates kanban_boards, kanban_cycles (sprint windows with 0โ100 progress), kanban_columns (positioned lists), and kanban_cards (priority, estimate_hours, due_date, labels, assignee, position). Cards link to boards, cycles, columns, and optionally to time entries.
block B โ tables
4 tablesBlock C
Creates time_projects (rates, budgets, billable flags), time_entries (start/end, duration_seconds, invoiced flag, optional card link), invoice_clients, invoices (draft โ sent โ paid, with deleted_at for the 30-day trash), and invoice_line_items. Money-adjacent tables are owner-scoped: every policy keys off auth.uid() = user_id.
block C โ tables
5 tablesBlock D
Creates notifications (category, title, message, action_url, is_read) plus chat_threads, chat_participants, and chat_messages. Chat reads require thread membership; message inserts require the sender to be a participant.
Block E
Enable Row Level Security on every new table, then create the policies in spec order: squad/kanban membership checks, owner-only time and invoice policies, own-notifications read/update, and chat membership-gated read/insert. Run the whole RLS block as one transaction so a halfway policy set never ships.
Block F
Create the six indexes last: invoices by (user_id, deleted_at) for the trash tab, time_entries by (user_id, project_id, start_time), kanban_cards by (column_id, position), notifications by (user_id, is_read, created_at), chat_messages by (thread_id, created_at), and dps_nodes by (status, last_heartbeat).
Proof
Green on all six? Continue to squad workspaces. Anything red is a migration problem, not an app problem โ fix it here before opening the app pages.