PowerDesigner to modify foreign key naming rules

Source: Internet
Author: User
Tags powerdesigner

Modify a foreign key naming rule

Select Database->edit Current DBMS
Choose scripts-"objects-" reference-"Constname
You can see that the value on the right is:

fk_%. u8:child%_%. u9:refr%_%. u8:parent%

Visible, the naming method is: ' Fk_ ' + 8-bit child table name + 9-bit reference name + 8-bit parent table name, which you can customize according to this pattern:

fk_%. u7:child%_relations_%. u7:parent%,

You can change the FK name to Fk_table_2_relations_table_1
After mastering this method, you can revise it according to your own ideas.

Generating the header comments in the Build Library script SQL file is annoying, you can select the options card in the databse-> Generate Database (ctrl+g) window and remove the usage title Hook option.

Add foreign key
Model-> references New foreign key, double-click to enter the foreign key properties, in the "joins" card can select the child table foreign key field

How to implement name and code not automatically equal
How to implement when creating entity in CDM, name and code do not automatically correspond

Set tools--gerneral options--->dialog---->name to code mirroring

-------------------------------------

How to display the Name column in the Scrip

Modify the field generation rule. To add a comment to each field, the value of the expand Script-> Object-> Column-> Add in the same window is modified to:

%20:column% [%compute%?as (%compute%):%20:datatype% [%identity%?%i dentity%:[%null%][%notnull%]][default%default%]
[[Constraint%constname%] Check (%constraint%)]]/*%colnname%*/

The%colnname% is the name value of the column (Can be Chinese)

---------------------------------------------------------------------------------

Powerdesigen settings from the growth column

PDM to view the properties of the table, Columns tab, select an entire column, view column properties, point to the top left of the properties icon (with the hand pattern of the one), at this time open a settings window, the General tab inside to set.
There is an identity check box on the General tab of the column properties, which is on the hook.

--------------------------------------
1 How to build the index under PowerDesigner
2 How to build self-adding columns under PowerDesigner
3 How to check the design model under PowerDesigner

1 How to build the index under PowerDesigner
1 Double click the table design diagram, come out table Properties, select Indexes in tab page

2 Click the property of the new index to appear indexex properties

3 Add a field that contains an index

2 How to build self-adding columns under PowerDesigner
2 Use the following statements in the SQL Server database to complete
In the table statement, add the following in the field you want to do as a self-added column
IDENTITY (1,1)
You can also use the following statement to reset the self-increasing seed
DBCC CHECKIDENT (configsys,reseed,0);
3 How to check the design model under PowerDesigner
1 in the menu bar select Tools-check Model, the following figure

2 Select each setting that you want to check for 3 after determining, will come out to check the result summary information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.