Database Schema Studio
Import MySQL SQL or Laravel migrations, or design a schema visually, and get Laravel files or a Prisma schema live, as a ZIP. Runs in your browser.
Add a table on the left, load an example, or open a project file to start designing.
Generated files
Generated files appear here as you design.
Diagnostics appear here after you paste your input.
Processed locally in your browser. Your data never leaves your device.
About the Database Schema Studio
A visual editor for relational schemas. Add tables, add columns, set types, keys, defaults, unique constraints, indexes and foreign keys, and watch the Laravel migrations update as you work. It is built on the same Schema Engine as the migration generator: every edit is a checked operation, and the output is deterministic and idiomatic.
How to use it
- Type a name in the Tables panel and press Enter, load an example, or use Import SQL to start from a MySQL or MariaDB dump, or Import migrations to start from Laravel migration files.
- Add columns. Each row has its name, type and the flags you use most: Null, PK (primary key), AI (auto-increment), Unique and Index. Open Details for type options, a default and a comment.
- Add foreign keys and composite or named indexes below the columns.
- Switch to Diagram to see the tables and relationships as an ER diagram. Drag tables (or move them with the arrow keys) to arrange them; the layout is saved in the project file.
- Read the generated migrations on the right and the diagnostics underneath.
- Choose what to generate (models, factories, seeders, requests, resources), confirm any guessed relationships in the Relations panel, then Download all (ZIP).
- Download the project file to keep your work.
What the editor protects you from
- Duplicate table and column names (compared without case).
- Foreign keys, indexes and keys that point at columns or tables that do not exist.
- Removing or renaming something that other parts depend on: renames update every reference, and removals ask before taking dependents with them.
Keyboard and accessibility
Everything can be done with the keyboard. Text fields apply their change when you press Enter or leave the field, and Escape puts the old value back. Refusals are announced.
Frequently asked questions
- Is my schema saved?
- Not automatically. The design lives only on this page. Use Download project to save it as a small JSON file, and Open project file to continue later. If you have unsaved changes the browser asks before you leave.
- Can I start from an existing database or an existing Laravel project?
- Yes, two ways. Import SQL reads CREATE TABLE, ALTER TABLE and CREATE INDEX from a MySQL or MariaDB dump (INSERT data is skipped). Import migrations reads Laravel migration files and replays them in order (create, alter, rename, drop) without running PHP. What could not be imported is listed under Diagnostics with its line, and the imported schema is fully editable. There are landing pages for the common conversions: SQL to Laravel Migration, SQL to Prisma Schema and Laravel Migration to Prisma.
- Is there an ER diagram, and can I use it without a mouse?
- Yes: the Diagram view draws every table with its keys and the foreign-key relationships, laid out so referenced tables come first. Tables can be dragged or moved with the arrow keys, and a text version listing every table and relationship is always available. Very large schemas are drawn by name only, and above 300 tables only the text version and the form are shown.
- Is anything uploaded?
- No. Editing and code generation happen in your browser. Nothing you design is sent to a server, stored, or logged.
- Why was my change refused?
- Every edit is checked so the schema stays valid. For example, you cannot remove a column that a foreign key uses. The message says what depends on it, and offers an explicit button to remove those dependents together.
- Which frameworks does it generate for?
- Two outputs, chosen in the Output menu: a Laravel 12 or 13 project (migrations, Eloquent models, factories and seeders, with optional Form Requests and API Resources) and a Prisma 6 or 7 schema.prisma (with prisma.config.ts for Prisma 7). Either can be downloaded as a ZIP. The schema you design is framework-independent, so more outputs can be added without redesigning anything.
- Why did my pivot table not become a many-to-many relationship?
- A table that only looks like a pivot could also be a real entity, so relationships are never guessed silently. The Relations panel lists what was inferred; tick Confirm to turn a table into a belongsToMany relationship (it then gets no model of its own).
- How does it decide between foreignId and an explicit foreign key?
- It uses the short foreignId()->constrained() form only when it means exactly the same as the explicit key, and writes the table name out unless Laravel is certain to guess it. Anything that does not convert cleanly is listed under Diagnostics.