add custom page data model with split changesets and CRUD context

Stage 1 of custom CMS pages. Adds type/published/meta/nav fields to
pages schema, splits changeset into system vs custom (with slug format
validation and reserved path exclusion), adds create/update/delete
functions with auto-redirect on slug change, and warms custom pages
in ETS cache. 62 pages tests, 1426 total.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-28 01:56:19 +00:00
parent 356e336eef
commit cf627bd585
7 changed files with 449 additions and 25 deletions

View File

@@ -0,0 +1,14 @@
defmodule Berrypod.Repo.Migrations.AddCustomPageFields do
use Ecto.Migration
def change do
alter table(:pages) do
add :type, :string, default: "system"
add :published, :boolean, default: true
add :meta_description, :string
add :show_in_nav, :boolean, default: false
add :nav_label, :string
add :nav_position, :integer
end
end
end