ERwin is a commonly used tool for database design. It supports many databases. Unfortunately, it does not support MYSQL, probably because few enterprises use MYSQL, but MYSQL is actually very good.
To use ERWIN for MYSQL-based physical design, follow these steps:
(Assume that you already have a well-designed logical model)
1. Install the odbc driver of MYSQL. You can go to MYSQL. COM and download it through a link.
2. Create a user dsn to connect to your MYSQL database in the ODBC management program.
3. Generate a physical model based on ODBC 2.0 from the created logical model.
4. This step focuses on:
Because the database scripts generated based on ODBC are not fully compatible with mysql SQL syntax, you need to do other work. For example, sometimes datetime type is used, but only date type can be generated. We can use an SQL script. ERWIN supports two types of scripts: MODEL-LEVEL and TABLE-LEVEL. the former is for the entire physical model, while the latter can be used for one or more tables. According to the running order, there are two more types:
Pre Script, Post Script. You can see what the name means. If we want to set the TYPE of "CREATE_ON" in the TABLE to DATETIME, we can generate a TABLE-level script:
Alter table % TableName MODIFY CREATE_ON DATETIME % TableName is a built-in macro of ERWIN. There are many other macros. For more information, see help.
You can also define different scripts as needed (for example, you need to set a field to AUTO_INCREMENT ).
5. In forward engineer, select Pre Script and Post Script based on the actual situation and generate the Script.