PowerDesigner连接连接mysql逆向生成逆向生成PDM及相关问题及相关问题
准备工作准备工作
使用的使用的PowerDesigner版本为版本为16.5,下载地址下载地址:
链接:https://pan.baidu.com/s/1tUNjVHQ1bStfF__zaHbLkg
提取码:58zk
安装完成后需要先设置一下,解决生成的表中没有字段注释和表注释的问题:安装完成后需要先设置一下,解决生成的表中没有字段注释和表注释的问题:
1:点击工具栏中的数据库,选择第二个选项:
2:如图,将值替换为:
{OWNER, TABLE, TNAME}
select
t.table_schema,
t.table_name,
t.table_comment
from
information_schema.tables t
where 1=1
[ and t.table_schema = %.q:SCHEMA%] order by 1, 2
3:如图,将值替换为:
{OWNER, TABLE, COLNNAME,COLUMN, DATATYPE, NOTNULL, DEFAULT, IDENTITY, COMMENT, National, Unsigned, ZeroFill}
select
c.table_schema,
c.table_name,
c.column_comment,
c.column_name,
replace(replace(lower(c.column_type), ' unsigned', ''), ' zerofill', ''),
case(c.is_nullable) when 'NO' then 'notnull' else 'null' end,
c.column_default,
if(c.column_default is null, if(lower(c.extra) = 'auto_increment', 'identity', ''), ''),
c.column_comment,
case (ifnull(c.character_set_name, '-')) when '-' then null when 'utf8' then 'true' else 'false' end,
if(InStr(lower(c.column_type), ' unsigned')=0, '', 'true'),
if(InStr(lower(c.column_type), ' zerofill')=0, '', 'true')
from
information_schema.columns c
where 1=1
[ and c.table_name = %.q:TABLE%] [ and c.table_schema = %.q:OWNER%] order by
1, 2, c.ordinal_position
评论0