Prisma Generator
Generate a Prisma schema
Models
Prisma schema
Add a model, describe its fields, then click “Generate”: the schema will appear here.
About this tool
This tool writes the model blocks of a schema.prisma file from a simple form, so you do not have to remember the syntax. It helps you sketch a database structure for a new project or prototype, or get the @id, @unique, @default and @relation attributes right without digging through the Prisma documentation.
Each field is a String, Int, Boolean, Float or DateTime and can be a primary key, unique or required. Default values accept uuid(), cuid(), now(), autoincrement() or a fixed value that matches the type. One checkbox adds createdAt and updatedAt, and one-to-one, one-to-many, many-to-one and many-to-many relations generate the fields on both sides.
How to use it
- Click “Add Model” and enter its “Model Name”.
- Click “Add field” for each column, choose its type and check “Primary Key”, “Unique” or “Required”.
- Check “Add CreatedAt/UpdatedAt” if needed and, to link two models, “Create Relation” with a “Related Model”.
- Click “Generate”, then “Copy” to grab the schema.
Frequently asked questions
Does the output include the datasource and generator blocks?
No, the tool only produces model blocks. Paste them into your existing schema.prisma below the datasource and generator blocks, then run prisma migrate or prisma db push as usual. It does not create migrations or a client.
How are relations written?
For one-to-one, one-to-many and many-to-one relations, the tool adds a foreign key named after the related model (for example userId) with @relation and onDelete: Cascade, plus the matching list field on the other side. Many-to-many adds a list on both sides.
Which default values are supported?
The uuid(), cuid(), now() and autoincrement() functions, or a fixed value that fits the type: text for String, an integer for Int, a number for Float, true or false for Boolean. An incompatible value is flagged instead of producing an invalid schema.
What are the limitations?
Each model needs exactly one primary key, and names may only contain letters, digits and underscores. Self-relations are not supported, and each model can declare a single relation from the form.