Stage 1 of the page builder: Pages schema with 14 valid slugs, BlockTypes registry (26 block types with settings schemas and data loaders), Defaults module matching existing templates, ETS-backed PageCache GenServer, and Pages context (get_page/save_page/reset_page with cache -> DB -> defaults lookup). 34 tests, zero visual change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
396 B
Elixir
17 lines
396 B
Elixir
defmodule Berrypod.Repo.Migrations.CreatePages do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:pages, primary_key: false) do
|
|
add :id, :binary_id, primary_key: true
|
|
add :slug, :string, null: false
|
|
add :title, :string, null: false
|
|
add :blocks, :map, default: "[]"
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
create unique_index(:pages, [:slug])
|
|
end
|
|
end
|