When using PowerDesigner to design the ORACLE library table in the past, it is very convenient to generate the SQL statement to build the table. There is an option, which means that when the COMMENT is empty, the NAME of this field is used as the COMMENT. This way down , The remarks of the fields of the table are very clear in the database. The most recent project has been changed to a MYSQL database, and I found that this function is not very useful. There are also ways to generate comments on the Internet, but you can only use the NAME as a COMMENT. When your COMMENT originally has value, it will be replaced by NAME, which is a big flaw.
If you don’t say anything, now start to talk about COMMENT first generation (COMMENT==NULL?NAME:COMMENT) ) Configuration method:
1. Open the menu item DataBase-> Edit Currunt DBMS…,
In the General tab, Open Script->Object->Column->ColumnComment,
paste in Value on the right The following code:
alter table %TABLE%
modify column %COLUMN% %DATATYPE% [%NOTNULL%] [default %DEFAULT%][%IDENTITY%? AUTO_INCREMENT:] COMMENT %.q :COMMENT%
The above code is recommended to be pasted as it is, including line breaks and spaces, etc., which will affect the format of the final generated SQL statement. With picture:
2. Find the menu item: Generate Database…,
In Format Tab, select Generate n ame in empty comment, just confirm it.
Note: The version of PowerDesigner is recommended to use 15.1. I have failed to configure in 12.5. The main manifestation is that I can’t find this option. :
After the above two steps are set, you can play happily.