Tips for generating foreign keys in powerdesigner

Source: Internet
Author: User
Tags powerdesigner

Yesterday, we used PD to design data. from CDM> PDM> dB, we found that the FK association established in CDM could not generate FK in the database, I wanted to add FK to the database myself. Later, I thought about the reason. Is there time, and 11 holidays? Haha, I'm Jiacheng...

No specific information was found on the website.ArticleLater, I began to work out a solution. The solution was as follows: first create a database in the DB, then create two more tables, add PK + FK, and reverse engineer to PD, I don't need to talk about this, do I? Simple ,,,

Finally, compare the FK under referenses in the two PDM systems ?)

FK attribute map under referenses of non-Reverse Engineering

FK attribute chart in reverse engineering referenses

Are there differences? One of the implementation options is trigger and the other is declarative. Now I have found it. Now I can change it here. In my mind, pay attention to the following list options, at the beginning, I just changed the trigger, but it was useless. Later I found that the following is different. I had to change the OK together. At the time of regeneration, the FK In the DB had to be done ,,, well, later I thought it was wrong. In this case, when the source PDM came from CDM and used CDM to generate PDM, the above property was still a trigger. If I had to manually change one side of the PDM, it would be okay if FK was not much better, what if there were a lot of things to do, so we had to start from the source and go to Baidu. Recently we had to worry about it and forget it or go to Soso. So we found a article about how to change PDM to implement it, do you want to find it yourself?

Then I returned to CDM and found the generate dialog box in tools-generate physical data model.

Figure 1:

Figure 2:

In Figure 2, you can set it like this. Of course, pay attention to the two options under default constraints.

This completes the configuration. You can re-run CDM-> PDM-> dB to see if it is not OK ,,,

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.