Files
Momento/memento-note/prisma/migrations/20260524200000_add_ai_consent_audit/migration.sql
Antigravity 0784c94242
Some checks failed
CI / Lint, Test & Build (push) Failing after 57s
CI / Deploy production (on server) (push) Has been skipped
feat(notes): vues structurées tableau/kanban, flashcards et MCP robuste
Ajoute la base organisable par carnet (schéma, champs partagés, valeurs par note)
avec activation guidée, tableau éditable, kanban et suppression de colonnes.
Corrige le multiselect en vue tableau et enrichit sidebar, grille et i18n FR/EN.
Inclut aussi les améliorations flashcards SM-2, l'audit consentement IA et la
robustesse du serveur MCP (config, validation, rate-limit, métriques).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 23:03:16 +00:00

27 lines
796 B
SQL

-- AiConsentLog (audit RGPD) + consentement persistant sur UserAISettings
CREATE TABLE IF NOT EXISTS "AiConsentLog" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"consent" BOOLEAN NOT NULL DEFAULT true,
"ipAddress" TEXT,
"userAgent" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "AiConsentLog_pkey" PRIMARY KEY ("id")
);
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_constraint WHERE conname = 'AiConsentLog_userId_fkey'
) THEN
ALTER TABLE "AiConsentLog"
ADD CONSTRAINT "AiConsentLog_userId_fkey"
FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
END IF;
END $$;
ALTER TABLE "UserAISettings"
ADD COLUMN IF NOT EXISTS "aiProcessingConsent" BOOLEAN NOT NULL DEFAULT false;