PhoenixKit.Migrations.Postgres.V17 (phoenix_kit v1.5.1)
View SourcePhoenixKit V17 Migration: Entities System (WordPress ACF-like)
This migration adds the dynamic entities system for creating custom content types
with flexible field schemas, similar to WordPress Advanced Custom Fields (ACF).
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_definitionfor flexible field schemas - JSONB
settingsfor 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
datacolumn for field values - JSONB
metadatafor 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