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

PhoenixKit V37 Migration: DB Sync - Connections & Transfer Tracking

This migration adds persistent connections and transfer tracking to the DB Sync module.

## Changes

### Connections Table (phoenix_kit_db_sync_connections)
- Permanent connections between PhoenixKit instances
- Sender-side access controls (approval mode, allowed/excluded tables)
- Expiration and download limits
- Additional security (password, IP whitelist, time restrictions)
- Receiver-side settings (conflict strategy, auto-sync)
- Full audit trail

### Transfers Table (phoenix_kit_db_sync_transfers)
- Track all data transfers (uploads and downloads)
- Record counts and bytes transferred
- Approval workflow support
- Request context for security

## Key Features

- **Approval Modes**: auto_approve, require_approval, per_table
- **Expiration**: Time-based and usage-based limits
- **Security**: Password protection, IP whitelist, time-of-day restrictions
- **Audit Trail**: Full tracking of who approved/suspended/revoked connections

# `down`

Rollback the V37 migration.

# `up`

Run the V37 migration to add DB Sync connections and transfers.

---

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