Sequelize schema design
Quick start guide for Sequelize schema design in Meteor Modeler.
- New project
- Sequelize models
- Code generation
1. New project
To create a new project, click the New item on toolbar and select Sequelize project type.
2. Sequelize models
To add new Sequelize model to your design, click the Model item on toolbar and then click the main diagram area.
New object appears in the diagram. You can edit Sequelize model properties via Right Side panel:
If you prefer modal dialogs, double click an item on diagram or open popup and choose Edit.
In section Details collection settings can be specified.
In section Fields you can add new fields to collections to your Sequelize schema design. Specify new field name, datatype, parameter and click Add.
REQ represents required field.
To access area where Sequelize field specifics can be modified, click the arrow left to the field name.
3. Sequelize associations
Associations are represented by links between sequelize models. New associations can be created by cliking the HasOne or BelongsTo icons on the main toolbar.
Each association can be configured as one-way association as well as bi-directional association.
If you wish to define association as Has One and Belongs To at the same time, draw just one line and define details on the Association properties modal form.
Each type of association is graphically represented in the diagram by a silghtly different line.
- Has one/Has many - solid line.
- Belongs to/Belongs to many - dashed line.
- Both - dash-dotted line
Cardinality: See how cardinality is solved in Moon Modeler for MongoDB. The visualization is identical.
4. Code generation
To preview validation script for your MongoDB schema design, click the Script tab on collection detail.
To save scripts to files, click the Script icon on toolbar and then click Save script.
This is the end of the Sequelize schema design page. Thanks for reading!