Clean up #15

Merged
l30n merged 13 commits from fix/migrations-squash into prototype 2026-03-23 01:58:53 +01:00
Owner

Closes #10

Closes #10
l30n added this to the v1.0.0 milestone 2026-03-22 17:30:49 +01:00
Closes #10

6 migrations with identical date 20260321 (grown iteratively during
prototyping) are replaced by 3 canonical migrations:

- 20260322000001_schema.sql  — enums, tables, indexes, RLS, realtime
- 20260322000002_card_data.sql — card_types seed data (unchanged)
- 20260322000003_rpcs.sql    — final offer_cards + redraw_cards

Changes vs. old RPCs:
- offer_cards: consolidates fixes from _003/_004/_005/_006 into one
- redraw_cards: taken from _005 unchanged
- Both RPCs now validate p_deck_num and RAISE EXCEPTION for invalid values

Note: requires Supabase DB reset on next deployment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- offer_cards and redraw_cards now take p_level public.card_level instead of
  p_deck_num INT, removing the INT→level mapping block
- Update draft.ts and [id].tsx callers accordingly (deckNum → level)
- Fix loadSession query selecting non-existent updated_at from users table,
  which caused immediate redirect to home after session creation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused styles (container, title, sessionTime) in index.tsx
- Add missing userId null-check in handleJoinSession
- Remove unused myParticipantRef and its useEffect in session/[id].tsx
- Replace fragile ternary deck-count lookup with countKey in draft/[id].tsx
- Deduplicate cardW/cardH calculation in draft/[id].tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
l30n changed title from Squash 6 Prototype-Migrations zu 3 sauberen Migrations to Clean up 2026-03-23 01:58:10 +01:00
l30n merged commit 635090578a into prototype 2026-03-23 01:58:53 +01:00
l30n deleted branch fix/migrations-squash 2026-03-23 01:58:53 +01:00
l30n referenced this pull request from a commit 2026-03-23 01:58:54 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
l30n/Challengers-Draft!15
No description provided.