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

PhoenixKit V04 Migration: Settings Module Column + Referral System

This migration adds modular settings support and implements the referral system
for enhanced user management and feature organization.

## Changes

### Settings Table Enhancement
- Adds module column to phoenix_kit_settings table for feature-specific settings
- Updates existing settings with appropriate module associations
- Maintains backward compatibility with existing settings

### Referral System
- Adds phoenix_kit_referral_codes table for managing referral codes
- Adds phoenix_kit_referral_code_usage table for tracking code usage
- Supports referral code creation, validation, and usage tracking
- Integrates with settings system for referral-specific configuration

## PostgreSQL Support
- Supports PostgreSQL prefix for schema isolation
- Proper foreign key relationships and constraints
- Optimized indexes for performance

# `down`

# `up`

Run the V04 migration to add module column and referral system.

---

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