Generating Database from ERD
Once you have designed your database with ERD, you can generate the actual database from it, or to generate the DDL file for manual database creation.
Generating Database from ERD
- Select Tools > DB > Generate Database... from the toolbar. This opens the Database Generation window.
Database Generation window - Select Create Database for Generate Database.
Create database - Check and/or uncheck Export to database and Generate DDL. Sometimes, you may want to review and modify the DDL scripts for database creation, instead of having the database be created completely based on your design. If this is what you want, uncheck Export to database and check Generate DDL. If you want database to be created automatically based on your ERD, check Export to database.
Select Export to database - Make sure you have chosen and configured the default database. You can only generate database if you have chosen the default database.
Default database specified - Configure the other generation options. Read the next sections for details about those available options.
- Click OK. If succeed, and if you have chosen Export to database, you will see the database schema be created in the chosen database. If you have chosen Generate DDL, you can find the DDL file in the folder specified in the Output Path field.
Overview of Database eneration window
Database Generation window |
|
||||||||||||||||||||||||||||||||||||||||
Overview Database Generation |
Personal/Production Connectivity
Database is one of the key components of an information system. In order to keep a system stable, separate databases are used for development and production so that database changes can be made freely. And when tested, changes can be patched to the production database.
Visual Paradigm enables you to share database design through VPository.com, a cloud -based repository of software design projects. This allows development and production environments to work consistently with the same and latest set of database design. Although different environments can share the same database design, it is impractical to have them share the same set of database connection information. For instance, developer Peter may have 'demo' as database name, with 'peter' as login, while developer Mary may have 'dev' as database name and 'mary' as login. The production environment, certainly won't name the database as 'demo' or 'dev'.
Due to the fact that different environments can have their own set of database settings, it is a bad idea to bind the database connection setting required in generating ORM code and updating database along with the design. If that's the case, all users will require a re-configuration of setting for their own environments prior to generating ORM code and/or updating database schema. This is not just cumbersome, but may corrupt important data in database if a wrong connection setting is supplied by mistake. For these reasons, Visual Paradigm supports personalizing the database connection information so that each user can have their own set of database connection setting. To be specific, the personalized setting is stored within workspace instead of project. Therefore, it will not affect any other user and the production environment. It affects only the generated Hibernate files and the database in specific environment.
To use this feature, simply click on the drop-down menu labeled Production, inside the JDBC section. Then, select Personal and enter your own connection URL. Database generation will apply the connection URL you supplied.
Select Personal database setting |
Related Resources
The following resources may help you to learn more about the topic discussed in this page.
2. Reverse Engineering ERD from DDL | Table of Contents | 4. Patching Design Changes to Database |