PhoenixKit.Migrations.Postgres.V43 (phoenix_kit v1.7.71)

Copy Markdown View Source

PhoenixKit V43 Migration: Legal Module

This migration introduces the Legal module infrastructure for GDPR/CCPA compliance, including consent tracking and legal page management.

Changes

Phase 1: Settings Seeds

  • legal_enabled: Module enable/disable toggle
  • legal_frameworks: Selected compliance frameworks (JSON array)
  • legal_company_info: Company information for legal pages (JSON)
  • legal_dpo_contact: Data Protection Officer contact (JSON)
  • phoenix_kit_consent_logs: User consent tracking for cookie banners
  • Supports both logged-in users and anonymous visitors
  • Tracks consent type, version, and user fingerprint
  • legal_consent_widget_enabled: Cookie consent banner toggle
  • legal_cookie_banner_position: Banner position (bottom, top, etc.)

PostgreSQL Support

  • JSONB storage for flexible metadata
  • Optimized indexes for consent queries
  • Supports prefix for schema isolation

Usage

# Migrate up
PhoenixKit.Migrations.Postgres.up(prefix: "public", version: 43)

# Rollback
PhoenixKit.Migrations.Postgres.down(prefix: "public", version: 42)

Summary

Functions

Rollback the V43 migration.

Run the V43 migration to add the Legal module infrastructure.

Functions

down(opts)

Rollback the V43 migration.

up(opts)

Run the V43 migration to add the Legal module infrastructure.