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 TABLEstatements 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:
Diagram layouts
Where each table sits on the diagram. DbSchema draws a new diagram.
Diagram groupings
The smaller views of a large schema. You rebuild them as groups.
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
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
.dbsfile. 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.
| Erwin part | In the DDL script |
|---|---|
| Tables, columns, nullability | Yes |
| Data types and defaults | Yes |
| Primary and foreign keys | Yes |
| Unique indexes and check rules | Yes |
| Table and column comments | Only if the script writes them |
| Diagram layouts and groupings | No |
| User-Defined Properties | No |
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].
-
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.
-
Pick the script
Under Read from, choose Files, press Choose and pick the script.
-
Choose a new model
Under Put the result in, choose A new model.
-
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.
-
Load the model
Press Load Model.
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.
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].
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.
| DbSchema | Erwin with erwin Mart Portal | |
|---|---|---|
| Where the design lives | One .dbs file | A database behind erwin Mart Portal |
| How the team shares it | Git | erwin Mart Portal |
| Server to run | None | Windows Server and a database |
| Documentation | HTML5, PDF, Markdown | Reports 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
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.