Version Diff¶
Compare two snapshots of a diagram to visually review changes and auto-generate Alter Scripts for database migration.
Version History¶
Every time a diagram is saved, a version history entry is automatically recorded.
- View previous versions in the Version History tab in the right panel
- Each version shows the save timestamp and author information
- Select any two versions to start the comparison
Visual Diff¶
When two versions are selected, changes are visualized directly on the canvas. Different visual effects are applied based on the type of change.
Change Indicators¶
| Type | Visual Effect | Meaning |
|---|---|---|
| Added Entity | 🟢 Green highlight + pulse animation | Newly created table |
| Removed Entity | 🔴 Red ghost node (semi-transparent) | Deleted table |
| Modified Entity | 🟡 Yellow highlight | Table with changed attributes |
| Added Column | Green highlight | Newly added column |
| Removed Column | Red strikethrough | Deleted column |
| Changed Attribute | Yellow background | Column with type, NULL, or other changes |
Change List Panel¶
A Change List Panel is displayed next to the canvas:
- Changes categorized by type (Added/Modified/Deleted)
- Click each item to auto-navigate to its position on the canvas
- View detailed change content (previous value → new value)
Practical Workflow: Schema Change Management¶
A step-by-step guide to using the version diff feature in practice.
Scenario: Adding a Column to the Customer Table¶
- Make the change: Add a
Last Login Datetimecolumn to theCustomerentity - Save: A new version is automatically created when changes are saved
- Run comparison: Select the previous version and the current version in Version History
- Review Visual Diff: The
Customerentity is highlighted 🟡 yellow on the canvas, and theLast Login Datetimecolumn appears 🟢 green - Generate Alter Script: Click the Generate Alter Script button from the diff results
- Review and apply the script:
- Apply the generated script to the development DB
Diff Engine¶
The Diff Engine structurally compares two snapshots to analyze changes:
| Comparison Target | Analysis Items |
|---|---|
| Entities | Added, deleted, renamed |
| Columns | Added, deleted, type/attribute changed, reordered |
| Relationships | Added, deleted, cardinality changed |
| Subtypes | Added, deleted, discriminator value changed |
Alter Script Integration¶
Based on the diff results, an Alter Script is auto-generated via SQL Export. This produces a migration script to convert the current schema to the target schema.
Supported ALTER Statements¶
| Change Type | Generated DDL |
|---|---|
| Column added | ALTER TABLE ... ADD COLUMN ... |
| Column type changed | ALTER TABLE ... ALTER COLUMN ... TYPE ... |
| Column dropped | ALTER TABLE ... DROP COLUMN ... |
| Table added | CREATE TABLE ... |
| Table dropped | DROP TABLE ... |
| Relationship added | ALTER TABLE ... ADD CONSTRAINT ... FOREIGN KEY ... |
| Relationship removed | ALTER TABLE ... DROP CONSTRAINT ... |
Review before applying Alter Script
Always test auto-generated Alter Scripts in a development/staging environment before applying to production. Column deletions and type changes in particular can cause data loss.