博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
powerdesigner 遇到的各种问题总结
阅读量:6888 次
发布时间:2019-06-27

本文共 2611 字,大约阅读时间需要 8 分钟。

1. 设置自增

 

打开表 -- 在具体列的前面双击即可添加各种属性

2. 生成sql 时设置编码

  database --> generate database --> format --> encoding

3. 生成sql 时name作为注释

  3.1 1 database --> edit current dbms --> Script--> Object--> Column--> ColumnComment

  3.12 将ColumnComment的value改为comment on column [%QUALIFIER%]%TABLE%.%COLUMN% is %.q:COLNNAME%

  注: 第二步中有的版本value是有值的,有的版本是空的,我的版本就是空的

  3.13 数据库---> Deneration Database --> Format--> 勾选Generate  name in empty comment

  参考: https://blog.csdn.net/shixun67/article/details/77521076

  ---- 上面的方法可惜没有解决我的问题, 下面是我采用的方法

  3.2  Tools->Execute Commands->Edit/Run Scripts,执行下面的脚本

  

'把pd中那么name想自动添加到comment里面'如果comment为空,则填入name;如果不为空,则保留不变,这样可以避免已有的注释丢失.Option Explicit ValidationMode = TrueInteractiveMode = im_Batch Dim mdl ' the current model ' get the current active model Set mdl = ActiveModel If (mdl Is Nothing) ThenMsgBox "There is no current Model "ElseIf Not mdl.IsKindOf(PdPDM.cls_Model) ThenMsgBox "The current model is not an Physical Data model. "ElseProcessFolder mdl End If' This routine copy name into comment for each table, each column and each view ' of the current folder Private sub ProcessFolder(folder) Dim Tab 'running table for each Tab in folder.tables if not tab.isShortcut then if trim(tab.comment)="" then '如果有表的注释,则不改变它.如果没有表注释.则把name添加到注释里面. tab.comment = tab.name end if Dim col ' running column for each col in tab.columns if trim(col.comment)="" then '如果col的comment为空,则填入name,如果已有注释,则不添加;这样可以避免已有注释丢失.col.comment= col.name end if next end if next Dim view 'running view for each view in folder.Views if not view.isShortcut and trim(view.comment)="" then view.comment = view.name end if next ' go into the sub-packages Dim f ' running folder For Each f In folder.Packages if not f.IsShortcut then ProcessFolder f end if Next end sub

然后可以将脚本保存为 name2comment.vbs(我保存了)

参考1:https://www.cnblogs.com/xujingyang/p/9071820.html

参考2: https://www.cnblogs.com/telwanggs/p/7698260.html

 

4. 有些很复杂的外键删除

  1. 首先可以只删除symbol(Delete Symbols only))

  2. 左边的工作空间里有References, 所有的外键可以在这儿编辑和删除

5. 设置字符集和存储引擎

  第一种方法:  

  1.1. Database => Edit Current DBMS => Mysql5.0 => Script => Objects => Table =>  Options

  1.2. 在右边的Value框内最后部分追加:

  ENGINE = %s : list = BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM, default = InnoDB
  DEFAULT CHARACTER SET = %s : list = utf8 | gbk, default = utf8
  1.3 双击表,选择Physical Options标签
  参考:https://www.cnblogs.com/lteal/archive/2013/08/23/3277092.html
  第二种方法:
  2.1 修改 安装目录 => Resource Files => DBMS => mysql50.xdb 文件
  注: 我没有尝试这种方法。。。
  参考:https://blog.csdn.net/maqingbin8888/article/details/82839040
  

转载于:https://www.cnblogs.com/lwmp/p/10028297.html

你可能感兴趣的文章
那些著名网站的90年代(转)
查看>>
lvs主备NAT模式上课用例(keepalived)
查看>>
jquery tips 提示层
查看>>
图解Oracle RAC全局缓存等待事件Global Cache Wait Events
查看>>
PHP需要学习成长路径
查看>>
Windows Server CA证书颁发机构续订
查看>>
jquery next()方法
查看>>
取IP地址
查看>>
Git详解之Git分支
查看>>
SaltStack部署Redis主从实现
查看>>
利用冗余实现企业局域网的高可用性
查看>>
nginx 配置页面压缩
查看>>
磁盘和文件系统管理(二)
查看>>
WCF中有关Session的小实验
查看>>
C#设计模式(13)——代理模式(Proxy Pattern)
查看>>
如何在VIEW 5中配置日志数据库
查看>>
android的互联网开发 下
查看>>
JDBC连接属性
查看>>
随手摘录
查看>>
《树莓派实战秘籍》——2.5 技巧25更新固件和预构建二进制内核的简易方法...
查看>>