Schema Designer

View as Markdown

The Schema Designer lets you create and modify database tables visually, generate model code, and review every planned change before it runs.

Browsing Tables

The left sidebar shows all tables in the database. Click a table to view its columns and indexes.

Creating Tables

  1. Click New Table
  2. Add columns with:
    • Name — Column identifier
    • Type — Pick from common types (INTEGER, TEXT, BOOLEAN, FLOAT, TIMESTAMP, JSONB, etc.) or enter a custom type
    • Nullable — Allow NULL values
    • Primary Key — Mark as primary key
    • Default — Default value expression
  3. Click Plan Create Table, then review and apply the plan (Plan Review)

Editing Tables

Select an existing table to:

  • Add columns — New column with type, nullable, default
  • Modify columns — Change type or constraints
  • Remove columns — Drop with confirmation
  • Changes are tracked as "dirty" until saved

Index Management

For each table:

  • View indexes — List all secondary indexes with their columns
  • Create index — Regular or unique, on one or more columns
  • Drop index — Remove with confirmation

Code Generation

Generate model boilerplate from your schema in four languages:

| Language | Output | |----------|--------| | Go | Struct with db and json tags | | TypeScript | Interface or type definition | | Rust | Struct with serde derives | | Python | Pydantic BaseModel class |

Switch between language tabs instantly. Copy to clipboard with one click.

Plan Review

The designer does not run DDL directly. Plan Create Table, Plan Changes, + Plan Index and Plan Drop Table send the edits to the CLI's own planner (the one neutron db push uses) and open a review of the planned statements, their risk (destructive, data loss, reversibility), the down statements, and the equivalent neutron db push --dry-run command. From the review:

  • Apply plan runs the statements in one transaction. A plan that drops objects or can lose data needs the acknowledgement checkbox first. If the live schema changed since the review so that the statements differ, nothing is applied and the fresh plan is shown for review. A database with migration history (_neutron_migrations) refuses apply, as neutron db push does.
  • Download target document saves target.schema.json, the schema document with the edits applied. On a migration-managed database, generate a migration from it with neutron migrate generate --schema target.schema.json --name <name>, adding the --rename flags the review's neutron db push --dry-run command shows when the edits rename columns (without them a rename is planned as an added column) and --mode snapshot after a neutron schema baseline, review it, then run neutron migrate.
  • Download SQL saves plan-<id>.sql for review: the up statements wrapped in one transaction, with the down statements as comments. It is not a migration file: neutron migrate reads only {version}_{name}.up.sql files.

Dropping Tables

Select a table and click Plan Drop Table. The plan review marks the drop as destructive, and Apply plan stays disabled until you tick the acknowledgement.