Back to all posts

What Carries Over When You Leave ERwin

What an Erwin schema keeps when it moves to DbSchema, what you rebuild, and how a model file in Git replaces the repository server.

On this page
Words in this article

Words in this article

DDL
Data definition language: the CREATE TABLE statements that build a database.
Forward engineering
Generating a DDL script from the Erwin model.
erwin Mart Portal
A model server that stores every Erwin model in a database of its own.
UDP
User-Defined Property: an extra field on a table or column, such as a data owner.
Reverse-engineer
Read the tables from the database's own list of objects.
Foreign key
A column that points to a row in another table.
Virtual foreign key
A link that exists only in the DbSchema model, never in the database.
.dbs file
The one file in which DbSchema saves the whole design.
Pull request
A proposed change that a colleague reads before it is merged.

The short answer

Most of an Erwin model moves to DbSchema in one step: tables, columns, data types, keys, indexes and check rules arrive intact. Three parts do not travel, because SQL has no place for them:

  1. Diagram layouts

    Where each table sits on the diagram. DbSchema draws a new diagram.

  2. Diagram groupings

    The smaller views of a large schema. You rebuild them as groups.

  3. User-Defined Properties

    Extra fields such as a data owner. Their text moves into comments.

Erwin Data Modeler is a data modeling tool from Quest: architects design a database in it before anyone builds it. Erwin writes the schema out as a DDL script, and DbSchema reads that script into a DbSchema model, one .dbs file. DDL stands for data definition language: the CREATE TABLE statements that build a database.

Larger Erwin teams share their models through erwin Mart Portal. That is a model server: a program on a company server that stores every Erwin model in a database of its own.

DbSchema comes in editions. Community is free and connects to every database. Pro adds the model file, importing scripts, synchronization and the full documentation. Architect adds logical design on top of Pro.

What DbSchema adds when you leave Erwin

Why DbSchema

See the steps ↓

Teams often leave Erwin to stop running a model server. DbSchema keeps the design work and drops the server. After the import, Auto Arrange Tables lays out the tables, and groups put related tables in one colored box.

  • No model server to install or run

    DbSchema saves the whole design in the .dbs file. Your team keeps that file in its Git repository, with built-in Git Collaboration.

  • Links the database never declared

    A virtual foreign key documents a link between two tables that has no constraint in the database.

  • The DbSchema model and the database kept in step

    Schema synchronization compares the two and writes the SQL for each difference you accept.

  • Documentation without a portal

    DbSchema writes HTML5, PDF or Markdown documentation from the DbSchema model, for readers who don't run DbSchema.

Then, in DbSchema:Import the scriptArrange and groupDocument

What an Erwin project holds

The Erwin model has several layers. The physical layer is the part a database understands: tables, columns, data types, keys, indexes and constraints. Above it sit the logical and conceptual layers. They describe business entities, such as Customer or Order, without naming a database product.

Two more layers exist only inside Erwin:

  • Diagram groupings split a large schema into smaller views.
  • User-Defined Properties, or UDPs, are extra fields on a table or column. A governance team uses them for a data owner, a sensitivity level or a retention period.

What carries over in the DDL script

To get the schema out, run Erwin's forward engineering. Forward engineering generates a DDL script from the Erwin model. Erwin's help says: "UDPs are not generated into your database"[1]. So the UDPs are not in the script either.

What travels from the Erwin model through the DDL script into the DbSchema model: tables, types, keys, indexes and comments carry over; diagram layouts, diagram groupings and User-Defined Properties have to be rebuilt
Erwin partIn the DDL script
Tables, columns, nullabilityYes
Data types and defaultsYes
Primary and foreign keysYes
Unique indexes and check rulesYes
Table and column commentsOnly if the script writes them
Diagram layouts and groupingsNo
User-Defined PropertiesNo

Open the script in a text editor and look for COMMENT statements. If there are some, the descriptions of tables and columns travel too.

Import the DDL script into DbSchema

DbSchema reads the script into a new DbSchema model. Nothing runs against a database. This import is a Pro feature[2].

  1. Open the Load Model dialog Pro

    Choose File → Import Model from SQL or Data Files. The Load Model dialog opens, the window where you pick the files to read.

  2. Pick the script

    Under Read from, choose Files, press Choose and pick the script.

  3. Choose a new model

    Under Put the result in, choose A new model.

  4. Set the DBMS

    Set DBMS to the database product the script was written for, for example SQL Server or Oracle. DbSchema reads the script with the SQL rules of that product.

  5. Load the model

    Press Load Model.

The DbSchema Load Model dialog, reading from Files, with A new model and its DBMS list under Put the result in

The DbSchema model opens with the tables and their foreign keys. A foreign key is a column that points to a row in another table. If DbSchema cannot read a statement, the Import Report lists the file that holds it. Compare the table count with Erwin before you go on.

Is the Erwin schema already running in a database? Then you can skip the script. Connect DbSchema to that database, and DbSchema reverse-engineers it: it reads the tables from the database's own list of objects. You get a DbSchema model with the same tables, and connecting is free in Community.

What you rebuild after the import

The layout comes first, and it is quick. Choose Diagram → Auto Arrange Tables. DbSchema places the tables by their foreign keys. Then drag the important tables where your reviews expect them. For a large schema, Diagram → New Diagram adds more diagrams to the same DbSchema model.

Groups replace Erwin's diagram groupings. Select the tables and choose Diagram → Create Group of Tables. A group is a colored box with its name in the corner.

Comments replace User-Defined Properties. Write the owner or the sensitivity level into the Comment box of the table or the column. The documentation shows these comments as tooltips on the diagram.

HTML5 documentation exported by DbSchema, with the ER diagram drawn as vector graphics, groups and a legend

Virtual foreign keys replace links on paper. A virtual foreign key exists only in the DbSchema model, and DbSchema never creates it in the database. Drag the child column onto the parent column and tick Virtual. DbSchema draws the link in another color.

A file in Git instead of a model server

Idera's ER/Studio, the other big enterprise suite, works the same way. It shares models through Team Server, "a web-based tool to access, search, edit and manage enterprise metadata"[3]. So leaving either suite means leaving a server.

erwin Mart Portal is a real job for someone. Quest says to install it on Windows, and lists Windows Server 2016, 2019 and 2022. erwin Mart Portal also needs a database of its own, on SQL Server, Oracle or PostgreSQL[4].

Erwin Workgroup shares the model through erwin Mart Portal on Windows Server and a repository database; DbSchema shares one .dbs model file through the team's Git repository

DbSchema has nothing like that to install. It runs on Windows, macOS and Linux. The shared design is the .dbs file in Git[5]. We recommend reviewing each change in a pull request, like application code. A pull request is a proposed change that a colleague reads before it is merged. DbSchema's Git guide adds two habits: commit one change at a time, and pull often.

DbSchemaErwin with erwin Mart Portal
Where the design livesOne .dbs fileA database behind erwin Mart Portal
How the team shares itGiterwin Mart Portal
Server to runNoneWindows Server and a database
DocumentationHTML5, PDF, MarkdownReports from erwin Mart Portal

Keep the DbSchema model and the database in step

DbSchema lets you work offline, which means you change the DbSchema model without a database connection. Meanwhile someone may change the database. So after a while the two differ, and DbSchema compares them for you:

  • From the database to the DbSchema model: Database → Refresh Model from Database lists the differences. Choose Review Differences to decide each one.
  • From the DbSchema model to the database: Database → Create or Upgrade Model in the Database generates the SQL script. You read the script before it runs.

The Erwin schema travels as a DDL script. Layouts, groupings and User-Defined Properties do not, and rebuilding them takes an afternoon in DbSchema. Connecting, reverse-engineering, the diagrams and the SQL Editor are free in Community; the import and the tools after it need Pro. Download DbSchema, import the script you forward-engineered out of Erwin, and put the .dbs file in Git.

Frequently asked questions

Can DbSchema open an .erwin file directly?

No: DbSchema has no importer for Erwin's own file format or its XML. Forward-engineer the physical layer to a DDL script, and import that script.

Does DbSchema keep Erwin's logical model?

Not from the script, which holds only the physical layer. DbSchema Architect has its own logical and conceptual design, where you rebuild the business view on top of the imported tables.

What happens to User-Defined Properties?

They stay in Erwin. Copy their values into the Comment box of each table or column, and the HTML5 documentation shows them as tooltips.

Sources

  1. Quest: User-Defined Properties (erwin Data Modeler help)
  2. DbSchema: Import and Export the Model
  3. Idera: ER/Studio Team Server quick start
  4. Quest: erwin Mart Portal prerequisites
  5. DbSchema: Git Collaboration

Open your Erwin model against your own database

DbSchema imports the SQL DDL you forward-engineer out of Erwin and lays the schema out as an ER diagram you can keep in Git. Connecting and the diagrams are free in the Community Edition; importing the script and schema synchronization are Pro.