# `PhoenixKit.Migrations.Postgres.V43`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/migrations/postgres/v43.ex#L1)

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)

### Phase 2 Prep: Consent Logs Table
- 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

### Consent Widget Settings (Phase 2)
- 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)

# `down`

Rollback the V43 migration.

# `up`

Run the V43 migration to add the Legal module infrastructure.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
