Your First Diagram
Create a project, add your first tables, define columns, and set up relationships. In 5 minutes you'll have a working ER diagram.
In this guide
- 1Sign up and create a workspace
- 2Create a data model
- 3Add your first table
- 4Define columns and primary keys
- 5Add a second table and create a relationship
- 6Arrange tables on the canvas
Step 1: Sign up and create a workspace
Go to app.erflow.io/register and create your free account. After signing up, you'll be prompted to create a workspace. A workspace is where all your data models live β think of it as a folder for your projects.
Give your workspace a name (e.g., "My Company" or "Personal Projects") and you're ready to go.
Step 2: Create a data model
From the workspace dashboard, click "New Data Model". Give it a name like "Blog Database" or "E-Commerce Schema". You can choose the database type (PostgreSQL, MySQL, SQLite, etc.) β this affects the column types available and the generated migrations.
After creating the data model, you'll land on the visual editor β a blank canvas ready for your tables.
Step 3: Add your first table
In the top toolbar, click the Table icon (or press the shortcut). Then click anywhere on the canvas to place your table. A dialog will appear asking for the table name β type users and confirm.
Your table appears on the canvas with a default id column (auto-increment primary key). You can drag it anywhere on the canvas.
Step 4: Define columns and primary keys
Click on the users table to select it. In the sidebar on the left, you'll see the table's columns. Click "Add Column" to add new columns:
- name β type:
varchar, length: 255 - email β type:
varchar, length: 255, unique: true - password β type:
varchar, length: 255 - created_at β type:
timestamp, nullable: true - updated_at β type:
timestamp, nullable: true
For each column, you can set properties like type, length, nullable, default value, and unique constraint. Click on a column to open its properties popover.
The id column is already marked as the primary key. If you need a composite primary key, you can select multiple columns.
Step 5: Add a second table and create a relationship
Add another table called posts with these columns:
- id β auto-increment primary key (created automatically)
- user_id β type:
bigint, unsigned - title β type:
varchar, length: 255 - content β type:
text - published_at β type:
timestamp, nullable: true
Now create a foreign key: click the Link icon in the toolbar (or press the shortcut) to enter "relate" mode. Click on the posts table first, then click on the users table. ER Flow will create a foreign key from posts.user_id β users.id.
A relationship line appears between the two tables, showing the cardinality (one-to-many). You can click on the relationship line to configure cascade rules (ON DELETE, ON UPDATE).
Step 6: Arrange tables on the canvas
Drag tables to arrange them logically on the canvas. Relationship lines follow automatically. You can:
- Zoom in/out with the scroll wheel or the +/- buttons in the toolbar
- Pan by clicking and dragging on the canvas background
- Select multiple tables by holding Shift and clicking
- Undo/Redo with Ctrl+Z / Ctrl+Shift+Z (or the toolbar buttons)
Your first ER diagram is complete! From here you can add more tables, create checkpoints, and generate migrations.