1 什么是Power Designer?
PowerDesigner
是Sybase
公司的一款软件,使用它可以方便地对系统进行分析设计,他几乎包括了数据库模型设计的全过程。利用PowerDesigner
可以制作数据流程图、概念数据模型、物理数据模型和面向对象模型等。在项目设计阶段通常会使用PowerDesigner
进行数据库设计,使用PowerDesigner
可以更加直观的表现出数据库中表之间的关系,并且可以直接导出相应的建表语句。
2 创建物理数据模型
3 从PDM导出SQL脚本
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2022/5/18 15:04:32 */
/*==============================================================*/
drop table if exists User;
drop table if exists "order";
/*==============================================================*/
/* Table: User */
/*==============================================================*/
create table User
(
uid int not null,
username varchar(32),
password varchar(32),
primary key (uid)
);
/*==============================================================*/
/* Table: "order" */
/*==============================================================*/
create table "order"
(
oid int not null,
uid int,
money float,
primary key (oid)
);
alter table "order" add constraint FK_Reference_1 foreign key (uid)
references User (uid) on delete restrict on update restrict;
4 逆向工程
通过SQL
脚本逆向生成PDM
模型,称之为逆向工程。
5 生成数据库报表文件