Field builder
The --fields string has a compact syntax with a few rules that are easy to forget: a relationship names its model, a vector needs its dimension, and choices go in brackets. Build it here instead.
Start from:
Singular and PascalCase. The generator produces the plural table, route and type names itself.
A single line
This row points at one other
Minor units and a currency
One of a list
Several lines
The syntax, if you would rather type it
A field is name:type, with optional extras after it, and fields are separated by commas.
title:string:requiredadds a modifier. The modifiers arerequired,uniqueandoptional.author:belongs_to:Usernames the related model in the third position. That is not a modifier, so modifiers come after it.status:select[draft, sent, paid]lists the choices. Writedraft=Draft in progresswhen the label is not just the value capitalised.embedding:vector[1536]gives the dimension, which is part of the column type rather than a setting.photo:file:imagerestricts what may be uploaded.slug:slug:titlesays which field the slug is built from.notes:text if status == disputedshows the field only when another field has a value. The same thing can be writtennotes:text:when=status=disputed.
The full list of types, with what each one produces across the stack, is in the field types reference.
