Support
Questions, bug reports or ideas? Email support@elteksw.com. Please include your macOS version and, if it helps, the model file that shows the problem.
Getting started
- Choose File → New Model, then Model → Add Entity.
- Add attributes and relationships to each entity. For a to-many relationship, create the inverse to-one on the other side.
- Fix anything listed as an error in the sidebar.
- Choose Model → Generate Fluent Code… and pick your Vapor project's
Sources/Appfolder. - In
configure.swift, callapp.migrations.addGeneratedMigrations().
Frequently asked questions
Which databases are supported?
The generated migrations target PostgreSQL. Default table and column names are lowercase, so firstName becomes firstname. You can override any name in the editor.
Will generating code overwrite my own work?
No. Files in Generated folders are replaced each time, and the app asks before doing so. Your own files, such as Models/Person.swift, are created once and never touched again.
Why can't I generate code?
Generation is blocked while the model has errors. The sidebar lists each one, for example an invalid name or a to-many relationship with no inverse.
Can I change a migration after it has run?
Once a migration has run against a real database, don't change it. Add a new migration for later changes.
Where are my models stored?
As plain JSON files wherever you save them, so you can keep them in version control.