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

PhoenixKit V24 Migration: File Checksum Unique Index

This migration adds a unique index on the checksum field of the phoenix_kit_files table
to enable efficient duplicate file detection and prevent duplicate file storage.

## Changes

### File Deduplication Support
- Adds unique index on phoenix_kit_files.checksum for O(1) duplicate lookups
- Enables automatic deduplication of uploaded files
- Prevents redundant storage of identical files

## PostgreSQL Support
- Supports PostgreSQL prefix for schema isolation
- Creates unique index for fast duplicate detection

# `down`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/phoenix_kit/migrations/postgres/v24.ex#L41)

Rollback the V24 file checksum indexing migration.

# `up`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.71/lib/phoenix_kit/migrations/postgres/v24.ex#L26)

Run the V24 file checksum indexing migration.

Handles existing duplicate checksums by keeping the oldest file and deleting newer duplicates.

---

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