After using PowerDesigner to design database relationships, HTML can be generated for team members to discuss.
Step 1: Create a new Report;
Select [file]---[new]---[Multi-Model Report], and then define the Report Name, which is mainly the name of HTML, and select Language.
Step 2: Select the Model to be generated;
In Model Name, select the Model that needs to generate HTML, and then select a Report template. It is recommended to select [Stand Physical Report], and then click [OK].
Step 3: Generate HTML;
Select the newly created Report, right-click, [Generate]---[HTML], and select the storage path. Then select [Save] and you're done.
2. Create an index
1. Double-click Table to pop up the Table Properties window:
2. Add a new index.
3. Select unique and set the index to be unique.
4. Double-click the row where the index is located, and the Index Properties window pops up.
5. Double-click the Add Column button to pop up the Selection window.
6. Select the columns of the table that the index contains, and click OK.
3. Add table comments and column comments
1. Table comment: Double-click the table to pop up the Table Properties window, fill in the comment
2. Column comment: Double-click the column in the tree menu on the left to pop up the column properties window, fill in the comment
Fourth, use PowerDesigner to design and build MySQL database
(1) Use PowerDesigner to create a database script
1. Design CDM (Conceptual Data Model)
2. Select Tools -> Generate Physical Data Model , select the corresponding DBMS as MySQL, and generate PDM
3. Select Database -> Generate Database , in the pop-up Select the script access path and script file name in the Database Generation dialog box
4. Click OK to generate the database database building script (*.sql)
(2) Use the database building script to create a database
1. Log in to mysql -u root -p
2. Create Empty databse create databse mydbse;
3. Create a user grant all on mydbse.* to [email protected] identified by 'password';
4. Exit exit;
5. Enter mysql -h 192.168.1.100 -u username - in the terminal p < Script.sql
6. Enter the password after pressing Enter
Five, PowerDesigner design table display annotation options
Table display comment options when PowerDesigner is designed:
Select the edited table, right-click -> Properties->Columns->Customize Columns and Filter (or directly use the shortcut key Ctrl+U)->Comment (check in front)->OK
6. PowerDesigner uses MySQL 's auto_increment
Open the table properties window → columns → select the id column → open the columns properties window → check the identity.
Seven, PowerDesigner removes the double quotes in the SQL script
Set Database → Edit Current DBMS → General → Script → Sql → Format → CaseSensitivityUsingQuote to NO
8. Set Entity to automatically resize in PowerDesigner
Right-click on Entity → click the Format... menu item → select the size tab → check Auto adjust to text
九、Generate Name in Empty Comment
I have been using PowerDesigner to design and generate the Oracle table structure, but manually supplement the Comment field of the column in the generated Oracle table.
Today, my colleague mentioned that PowerDesigner can automatically replace Comment with the description of Name (the effect can be seen in his PD, but he also forgot how to set it).
I found information on the Internet, and many of them say how to use the RUN SCRIPT method. Finally, after looking for the help of PowerDesigner, it turned out to be very simple. The settings are as follows:
[Database]->[Database Generation]->[Options] ->Generate Name in Empty Comment
If no Comment is written in the design, use Name instead.
10. When modifying the field Name of the table, does the Code not automatically change?
tools->General Options->Dialog:Operation Modes: NameToCodeMirroring(checked=false)
11. Remove the default new table name and field name plus double quotation marks
Open Database -> Edit Current DBMS, an editing interface appears, in the right box, find the script sub-node, and then find the sql -> format node in turn, there is a property with such a name: CaseSensitivityUsingQuote, set the value of this property to For "NO", and then look at the generated script, all double quotes are removed.