zoukankan      html  css  js  c++  java
  • create tables for mysql5 by PowerDesigner15

    First,  create concept-data-model.

    And then generate Physical Data Model from Concept-Data-Model.

    But there is something that we should pay attention to. I record them as follows.

    1. avoiding use mysql keywords like  "desc" as column name.

    you can use `desc` to avoid keyword conflict if you insist.

    But I recommend you to use another word liking explain,  addition.

    2. set charset utf-8  and set auto_increment   

    my target:

     1 /*==============================================================*/
     2 /* Table: student                                       */
     3 /*==============================================================*/
     4 create table student
     5 (
     6    id                   int not null auto_increment,
     7    rank_name            varchar(80) not null,
     8  
     9    primary key (id)
    10 )
    11 auto_increment = 1
    12 charset = UTF8;

    1) create db using charset utf-general_ci

    2) set charset for tables.

    1. 最新版的PD15中可能没有charset =(GBK)这一项,如果没有的话请按照下面的步骤进行手动添加
    2. 1、在PD安装目录下(我的PD安装路径是:C:Program FilesSybasePowerDesigner 15),找到Resource Files文件夹,在Resource Files中有个DBMS文件夹,找到里面的mysql50.xdb文件,用记事本打开。
    3. 2、按Ctrl+F键输入"checksum = %d : list = 0 | 1, default = 0",在其前方加入"charset = %s : list = UTF8 | GBK | GB2312, default = UTF8"如下图:

         4. create  physical-data-model;  select  Databases > Default Physical Options 

     

    3. set auto_increment  = 1, which means increment from 1.

    refering to step2.

    4. set auto_increment for id.

    use the physical data model and do as following instruction.

    powerdesigner中怎么给一主键设为自增型auto_increment-针对于Mysql数据库

    在你所要设为自增型的键上(比如你的id)双击,弹出一个Column Properties对话框,右下角有一个Identify的选择框,选中它OK,就可以了。
    再去查看Preview,就能看到用大写标识出来的AUTO_INCREMENT。

     

    Done! 

  • 相关阅读:
    洛谷月赛 Hello World(升级版)
    codevs1001 舒适的路线
    vijos & codevs 能量项链
    vijos 运输计划
    noip2016普及组题解和心得
    UVa 10891 Game of Sum
    UVa 10635 Prince and Princess
    某模拟题题解 2016.11.17
    贪心入门题
    某模拟题题解 2016.11.16
  • 原文地址:https://www.cnblogs.com/harrysun/p/3234043.html
Copyright © 2011-2022 走看看