PhoenixKit.Migrations.Postgres.V59 (phoenix_kit v1.7.71)

Copy Markdown View Source

V59: Publishing Module — Database Tables

Creates core publishing tables (4 tables) to support the filesystem-to-database migration of the Publishing module. Social features (likes, views) are deferred to later migrations.

Tables

  • phoenix_kit_publishing_groups — Content groups (blog, faq, legal, etc.)
  • phoenix_kit_publishing_posts — Posts within groups
  • phoenix_kit_publishing_versions — Version history per post
  • phoenix_kit_publishing_contents — Per-language content per version

Design

  • JSONB data column on every table for extensibility without future migrations
  • Real columns for indexed/queried/FK fields (status, slug, language, dates)
  • UUID v7 primary keys with uuid_generate_v7() default
  • Dual-write user FKs: created_by_uuid (UUID, FK) + created_by_id (bigint, no FK)
  • All timestamps use timestamptz (per V58 standardization)
  • One content row per language (mirrors filesystem one-file-per-language model)
  • Per-group feature toggles stored in data JSONB (comments_enabled, likes_enabled, etc.)

Idempotency

All CREATE TABLE and CREATE INDEX use IF NOT EXISTS. Safe to re-run.

Summary

Functions

down(opts)

up(opts)