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

PhoenixKit V17 Migration: Entities System (Dynamic Content Types)

This migration adds the dynamic entities system for creating custom content types
with flexible field schemas.
It also introduces `display_name_plural` to improve UI labelling for collections.

## Changes

### Entities Table (phoenix_kit_entities)
- Stores entity type definitions (content type blueprints)
- Includes singular and plural display names
- JSONB `fields_definition` for flexible field schemas
- JSONB `settings` for entity-specific configuration
- Supports dynamic content types like blog posts, products, team members, etc.

### Entity Data Table (phoenix_kit_entity_data)
- Stores actual records based on entity blueprints
- JSONB `data` column for field values
- JSONB `metadata` for additional information
- Generic columns for common fields (title, slug, status)

### Settings Seeds
- Inserts default entities-related settings (`entities_enabled`, etc.)

## PostgreSQL Support
- Leverages PostgreSQL's native JSONB data type
- Supports prefix for schema isolation
- Indexes on frequently queried columns
- Foreign key relationships

# `down`

Rollback the V17 migration.

# `up`

Run the V17 migration to add the entities system.

---

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