Beta . Ortha CMS is in public beta. Every plan is free until it ends.
Get started
Menu

Content · 5 / 23

Schema builder

Add types and fields in the admin, review the change, and apply it as the TypeScript file and migration you would have written.

Content ModelArticles Discard changes Review changes
Collections
Articles Authors Categories
Pages
Home New content type
Articles builder
Content built-in tab 4 fields5 fields Groups
Title title Short text
Slug slug Short text
Summary summary Long text
Body body Rich text
Read time readTime new Number
Add field
Content ModelArticlesAdd a field
  1. 1Kind
  2. 2Basics
  3. 3Rules and display
Kind of field
Short text One line: a title, a name, a slug. Long text A plain box of text, no formatting. Rich text Headings, lists and links: a body. Number A count, a rating, a position. Yes / no A switch: featured, archived. Date A day, without a time.
Label
Read time
Machine name
readTime

Follows the label until you type one.

Required Needed to publish.
Whole numbers only Stored as an integer.
Back
Content ModelArticlesReview changes
  1. 1Changes
  2. 2Files and SQL
  3. 3Apply
Add readTime to article Adds a column existing entries leave empty. Safe
src/content/collections/article.ts changed
0008_add_article_read_time.sql
ALTER TABLE "content_article"
  ADD COLUMN "read_time" integer;
Migration name
add_article_read_time
Applying the content model Applied
Generating and running the migration
Waiting for the server to restart
The content model is live

One migration in one transaction, then article.ts rewritten. Commit both with the code that reads the field.

Back

How it works

  1. 01

    Add a type or a field in the Content Model page, in development.

  2. 02

    Review each change’s verdict, the files and the SQL drizzle-kit wrote.

  3. 03

    Apply: the migration runs, the files are written, the server restarts.

Writes
TypeScript and a drizzle-kit migration
Runs
In development only
Owns
No tables, no runtime schema

In depth · For whoever sets up the model

A form that writes your code

Add a type or a field in the admin, review the change, and apply — your repository gets a type module and a drizzle-kit migration to commit.

It writes files, nothing else

The builder has no table and no runtime registry. It writes the same formatted TypeScript a person would, and drizzle-kit generates the SQL. Delete the builder and every type it made keeps working.

Under the hood

It edits only files whose first line is // @orthacms-generated. Hand-written types are shown read-only and never rewritten.

The type file the builder wrote, with its ownership marker, beside the table after its migration added the read_time column.

Both files land in your working tree, ready to commit.

Every change gets a verdict

Verdict What it covers
Safe New types, optional fields, labels and order.
Check data Tightened rules; existing values may no longer pass.
Deletes data Removed fields or types, each confirmed on its own.
Not applied Renames and type changes — make those in code.

Safe to apply

Checked as you type
The form uses the server’s own rules and wording.
All or nothing
The migration runs in one transaction; files are written only after it commits.
Never a prompt
Removals and additions run as separate migrations, so drizzle-kit never has to ask.
One apply at a time
A stale draft is told so instead of overwriting someone else’s change.
New types start ungranted
After an apply, the admin offers which workspaces get the new type.

Development only

Editing needs SCHEMA_BUILDER=true, a non-production NODE_ENV and the source tree. In production the page is a read-only map, and schema changes ship like any other code.

Questions

Is a generated type different from one I write?

No. It is the same collection() call. Remove the marker line and the file is yours to edit by hand.

Who can use it?

Anyone who can read content sees the model. Editing it needs schema:manage, which only administrators hold.

Full reference in the docs