1. Create a new model
Open PowerDesigner
and click as shown in Create Model...
the figure:
Or click on the 文件
menu bar 新建模型
to create a new one, as shown in the figure:
After the new creation, you will switch to the model type ( Model types
) tab, select Physical Data Model
(Physical Data Model), and then select Physical Diagram
, as shown in the figure:
After selecting, in Enter below 模型名称
and 数据库类型
click OK
to create a new one.
2. Table design
After the model is created, click the table icon on the right and create the table in the left panel as follows. Double-click the table, find the tab, and Columns
add column fields to the database table, as shown in the picture: As
shown in the picture above, the created table has no Comment
description by default. Field
If we want to display Comment
the description field, we need to double-click the table, then enter Columns
the options page, click Customize Columns and Filter
the button, and then check it Comment
, as shown in the figure:
After we check Comment
and save, we see it in Table Properties
the window Columns
tab page Comment
, As shown in the picture:
However, after saving and returning to the design view, the Comment information is still not seen, which is very inconvenient for our design. At this time, we find the -> button
in the toolbar , as shown in the picture: Create a new one in the opened dialog box, and then Click the button, as shown in the picture: Right click, click , as shown in the picture: Select , then click , as shown in the picture: Then select , right click and select -> , as shown in the picture: Name a name (such as AttributeComment), select String as dataType, select Computer, Read only Note: You cannot use Comment for the name because it is a built-in name. If you use it, you will be prompted to have a duplicate name, as shown in the figure: Switch to模型
Extensions
List of Extensions
属性
Profile
Add Metaclasses
Column
OK
Column
New
Extended Attribute
Get Method Script tab
%Get% = ""
Change to %Get% = Rtf2Ascii (obj.Comment)
, as shown in the figure: Confirm to save, return to the view interface, find ->
in the toolbar, as shown in the figure: click -> in sequence , as shown in the figure: select , and then click the button on the right side, as shown in the figure: Find the previously set , check and save, as shown in the figure: Return to the view interface, and the fields can be displayed now , as shown in the figure:工具
显示首选项
Table
Advanced
Columns
List Columns
Select
AttributeComment
table
Comment