Scrum4Me/prisma
Madhura68 075cf28a5e feat(ST-1001): add LoginPairing model + pg_notify trigger via migration
Schema (prisma/schema.prisma):
- model LoginPairing met id (cuid), secret_hash + desktop_token_hash (beide NOT
  NULL — scheiden mobiel- en desktop-bewijs), status (pending|approved|consumed
  |cancelled), optionele user_id met onDelete: SetNull, desktop_ua VarChar(255),
  desktop_ip VarChar(45) voor IPv6, created_at + expires_at + approved_at +
  consumed_at, indexes op (expires_at) en (status, expires_at)
- back-relation login_pairings LoginPairing[] op User

Migratie (20260427200734_add_login_pairing):
- Prisma-gegenereerde DDL voor login_pairings + indexes + FK
- Toegevoegde notify_pairing_change() functie + login_pairings_notify trigger
  op AFTER INSERT/UPDATE; emit pg_notify('scrum4me_pairing', payload) met
  { op: 'I'|'U', pairing_id, status }
- DELETE niet ondersteund — pairings gaan naar consumed/cancelled, niet weg
- Channel naam analoog aan scrum4me_changes uit ST-801

Verification: Node pg-client roundtrip-test via DATABASE_URL toonde notifies bij
INSERT (op=I) en UPDATE (op=U) met correcte payload-shape.

Bouwt voort op M8 LISTEN/NOTIFY-infra. SSE-route /api/auth/pair/stream/[id] in
ST-1004 abonneert hierop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 22:10:51 +02:00
..
migrations feat(ST-1001): add LoginPairing model + pg_notify trigger via migration 2026-04-27 22:10:51 +02:00
seed-data chore(M10): swap demo-active sprint from M3.5 to M10 2026-04-27 21:54:29 +02:00
neon.md fix: lint errors en warnings opgelost voor CI 2026-04-24 14:09:03 +02:00
schema.prisma feat(ST-1001): add LoginPairing model + pg_notify trigger via migration 2026-04-27 22:10:51 +02:00
seed.ts chore(M10): drop hardcoded Solo Paneel demo data from seed 2026-04-27 22:00:58 +02:00