PowerDesigner MySQL PDM comment note

Source: Internet
Author: User
Tags powerdesigner

PowerDesigner MySQL PDM comment Note2012-11-01 15:38 4447 People read comments (0) report Classification:Database related (7) PowerDesigner MySQL PDM comment note

First, Generate comments

The default PD does not generate comments and can be modified as follows for mysql5.0.
At the Database-->edit current DBMS ...

Set the properties of the DBMS to find the Mysql5.0-->script-->objects-->column-->add

Put the original content:

SQL code
  1. %20:column% [%national%? National]%datatype%[%unsigned% unsigned][%zerofill%? zerofill][[. o:[character Set][charset]]%charset%][. z:[%notnull%][%identity% auto_increment:[ default%default%]][comment%.q: @OBJTLABL%]]

Switch

SQL code
  1. %20:column% [%national%? National]%datatype%[%unsigned% unsigned][%zerofill%? zerofill][[. o:[character Set][charset]]%charset%][. z:[%notnull%][%identity% auto_increment:[ default%default%]][comment%.q:comment%]] /c3>

In fact, only the last @objtlabl changed to comment on the line.

The generated code has a comment for each field:

SQL code
  1. Drop table if exists admin;
  2. /*==============================================================*/
  3. /* Table:admin * /
  4. /*==============================================================*/
  5. Create Table Admin
  6. (
  7.    id                     int ( ) not null auto_ Increment comment 
  8.    user_name             varchar (+)  comment  
  9.     password               varchar (+)  comment 
  10. User_kind varchar (2) Comment ' user type ',
  11. Is_online varchar (1) Comment ' online logo ',
  12. Last_login Date Comment ' Last landing time ',
  13. Last_logout Date Comment ' last log out time ',
  14. primary key (ID)
  15. );
  16. Alter table admin Comment ' login system user Information table ';

Notes for the table:

To set the properties of the DBMS, locate mysql5.0-->script-->objects-->table-->tablecomment:

Value, add the following:

ALTER TABLE [%qualifier%]%table% comment%.60qa:comment%

When added, the following statement is generated:

ALTER TABLE code comment ' Codes table ';

Code generation:

Click menu Database-->generate Database

The Database Generation screen appears: In the Format tab, tick generate name in empty comment

Click OK to generate the appropriate code, and the comments above will appear in the code.

Ii. Removal of annotations

The existence of annotations is mainly for everyone to see, when using PowerDesigner design database, to write a lot of comment let people see, generate SQL file also contains these comment, but with this SQL file generation database, often because comment too long to fail, The deletion of 1.1 points in the file comment is too troublesome. Here's a way to get PowerDesigner to generate SQL files without comment.

Select Database->edit Current DBMS, click Open Script, objects, table, create, in value will be the last [comment = "%tlabl%"] Delete, this is to remove the comment that created the table.
Script---objects, column, create, in value will be the last [Comment%.Q: @OBJTLABL%] removed, this is to remove the column of the comment.
This produces no comment when the SQL file is generated.

There is also a point, if the database design has index, generate SQL file will drop index to the front of the file, when the first generation of the database, because there is no index so will be error, so to the top of the drop index deleted, but manually delete or trouble, Can do this:
CTRL + G, open database Generation, select the Options tab, select Index, and remove the √ right drop index before the

PowerDesigner MySQL PDM comment note

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.