Ignore:
Timestamp:
2008/08/04 00:47:07 (16 years ago)
Author:
Seasoft
Message:

PostgreSQLとMySQLのテーブル定義を近づけた

Location:
branches/comu-ver2/html/install/sql
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/html/install/sql/create_table_mysql.sql

    r17306 r17490  
    2222    create_date datetime NOT NULL , 
    2323    update_date datetime NOT NULL, 
    24     del_flg  smallint NOT NULL DEFAULT 0 
     24    del_flg smallint NOT NULL DEFAULT 0 
    2525) TYPE=InnoDB ; 
    2626 
     
    3434    create_date datetime NOT NULL, 
    3535    update_date datetime NOT NULL, 
    36     del_flg  smallint NOT NULL DEFAULT 0 
     36    del_flg smallint NOT NULL DEFAULT 0 
    3737) TYPE=InnoDB ; 
    3838 
     
    6767 
    6868CREATE TABLE dtb_update ( 
    69     module_id int NOT NULL UNIQUE, 
     69    module_id int NOT NULL, 
    7070    module_name text NOT NULL, 
    7171    now_version text, 
     
    8080    create_date datetime NOT NULL , 
    8181    update_date datetime, 
    82     release_date datetime NOT NULL 
     82    release_date datetime NOT NULL, 
     83    PRIMARY KEY (module_id) 
    8384) TYPE=InnoDB ; 
    8485 
     
    215216 
    216217CREATE TABLE dtb_mailmaga_template ( 
    217     template_id int auto_increment primary key NOT NULL UNIQUE, 
     218    template_id int auto_increment primary key NOT NULL, 
    218219    subject text, 
    219220    charge_image text, 
     
    269270 
    270271CREATE TABLE dtb_products ( 
    271     product_id int auto_increment primary key NOT NULL UNIQUE, 
     272    product_id int auto_increment primary key NOT NULL, 
    272273    name text, 
    273274    deliv_fee numeric, 
     
    330331 
    331332CREATE TABLE dtb_products_class ( 
    332     product_class_id int auto_increment primary key NOT NULL UNIQUE, 
     333    product_class_id int auto_increment primary key NOT NULL, 
    333334    product_id int NOT NULL, 
    334335    classcategory_id1 int NOT NULL DEFAULT 0, 
     
    354355    create_date datetime NOT NULL , 
    355356    update_date datetime, 
    356     del_flg  smallint NOT NULL DEFAULT 0, 
     357    del_flg smallint NOT NULL DEFAULT 0, 
    357358    product_id int 
    358359) TYPE=InnoDB ; 
     
    367368    create_date datetime NOT NULL , 
    368369    update_date datetime, 
    369     del_flg  smallint NOT NULL DEFAULT 0 
     370    del_flg smallint NOT NULL DEFAULT 0 
    370371) TYPE=InnoDB ; 
    371372 
     
    379380    create_date datetime NOT NULL , 
    380381    update_date datetime, 
    381     del_flg  smallint NOT NULL DEFAULT 0 
     382    del_flg smallint NOT NULL DEFAULT 0 
    382383) TYPE=InnoDB ; 
    383384 
     
    455456    create_date datetime, 
    456457    update_date datetime, 
    457     del_flg  smallint NOT NULL DEFAULT 0 
     458    del_flg smallint NOT NULL DEFAULT 0 
    458459) TYPE=InnoDB ; 
    459460 
     
    485486 
    486487CREATE TABLE dtb_news ( 
    487     news_id int auto_increment primary key NOT NULL UNIQUE, 
     488    news_id int auto_increment primary key NOT NULL, 
    488489    news_date datetime, 
    489490    rank int, 
     
    496497    create_date datetime NOT NULL , 
    497498    update_date datetime, 
    498     del_flg  smallint NOT NULL DEFAULT 0 
     499    del_flg smallint NOT NULL DEFAULT 0 
    499500) TYPE=InnoDB ; 
    500501 
     
    509510    create_date datetime NOT NULL , 
    510511    update_date datetime, 
    511     del_flg  smallint NOT NULL DEFAULT 0 
     512    del_flg smallint NOT NULL DEFAULT 0 
    512513) TYPE=InnoDB ; 
    513514 
     
    557558    create_date datetime NOT NULL , 
    558559    update_date datetime , 
    559     del_flg  smallint NOT NULL DEFAULT 0, 
     560    del_flg smallint NOT NULL DEFAULT 0, 
    560561    cell01 text, 
    561562    cell02 text, 
     
    570571    email varchar(50) NOT NULL UNIQUE, 
    571572    mail_flag smallint, 
    572     temp_id varchar(50) NOT NULL UNIQUE, 
     573    temp_id varchar(50) NOT NULL, 
    573574    end_flag smallint, 
    574     update_date datetime NOT NULL , 
    575     create_data datetime NOT NULL 
     575    update_date datetime NOT NULL, 
     576    create_data datetime NOT NULL, 
     577    PRIMARY KEY (temp_id) 
    576578) TYPE=InnoDB ; 
    577579 
     
    639641    update_date datetime, 
    640642    commit_date datetime, 
    641     del_flg  smallint NOT NULL DEFAULT 0, 
     643    del_flg smallint NOT NULL DEFAULT 0, 
    642644    deliv_date text, 
    643645    conveni_data text, 
     
    722724    create_date datetime NOT NULL , 
    723725    update_date datetime, 
    724     del_flg  smallint NOT NULL DEFAULT 0, 
     726    del_flg smallint NOT NULL DEFAULT 0, 
    725727    deliv_date text, 
    726728    conveni_data text, 
     
    774776 
    775777CREATE TABLE mtb_pref ( 
    776     pref_id smallint NOT NULL, 
     778    pref_id smallint primary key NOT NULL, 
    777779    pref_name text, 
    778780    rank smallint NOT NULL DEFAULT 0 
     
    800802    question text, 
    801803    create_date datetime NOT NULL , 
    802     del_flg  smallint NOT NULL DEFAULT 0 
     804    del_flg smallint NOT NULL DEFAULT 0 
    803805) TYPE=InnoDB ; 
    804806 
     
    828830    question06 text, 
    829831    create_date datetime NOT NULL , 
    830     del_flg  smallint NOT NULL DEFAULT 0 
     832    del_flg smallint NOT NULL DEFAULT 0 
    831833) TYPE=InnoDB ; 
    832834 
     
    939941CREATE TABLE dtb_templates 
    940942( 
    941     template_code        varchar(50) NOT NULL UNIQUE    , 
     943    template_code        varchar(50) primary key NOT NULL, 
    942944    template_name        text            , 
    943945    create_date        datetime        NOT NULL    , 
     
    960962    create_date datetime NOT NULL, 
    961963    update_date datetime NOT NULL, 
    962     del_flg  smallint NOT NULL DEFAULT 0 
     964    del_flg smallint NOT NULL DEFAULT 0 
    963965) TYPE=InnoDB ; 
    964966 
  • branches/comu-ver2/html/install/sql/create_table_pgsql.sql

    r17306 r17490  
    77    ok text, 
    88    create_date timestamp NOT NULL DEFAULT now(), 
    9     update_date timestamp NOT NULL DEFAULT now() 
     9    update_date timestamp NOT NULL DEFAULT now(), 
     10    PRIMARY KEY (log_id) 
    1011); 
    1112 
     
    2223    create_date timestamp NOT NULL DEFAULT now(), 
    2324    update_date timestamp NOT NULL, 
    24     del_flg  int2 NOT NULL DEFAULT 0 
     25    del_flg int2 NOT NULL DEFAULT 0, 
     26    PRIMARY KEY (kiyaku_id) 
    2527); 
    2628 
     
    3436    create_date timestamp NOT NULL DEFAULT now(), 
    3537    update_date timestamp NOT NULL, 
    36     del_flg  int2 NOT NULL DEFAULT 0 
     38    del_flg int2 NOT NULL DEFAULT 0, 
     39    PRIMARY KEY (holiday_id) 
    3740); 
    3841 
     
    6770 
    6871CREATE TABLE dtb_update ( 
    69     module_id int4 NOT NULL UNIQUE, 
     72    module_id int4 NOT NULL, 
    7073    module_name text NOT NULL, 
    7174    now_version text, 
     
    8083    create_date timestamp NOT NULL DEFAULT now(), 
    8184    update_date timestamp, 
    82     release_date timestamp NOT NULL 
     85    release_date timestamp NOT NULL, 
     86    PRIMARY KEY (module_id) 
    8387); 
    8488 
     
    154158    creator_id int4 NOT NULL, 
    155159    create_date timestamp NOT NULL DEFAULT now(), 
    156     update_date timestamp 
     160    update_date timestamp, 
     161    PRIMARY KEY (deliv_id) 
    157162); 
    158163 
     
    160165    deliv_id int4 NOT NULL, 
    161166    time_id serial NOT NULL, 
    162     deliv_time text NOT NULL 
     167    deliv_time text NOT NULL, 
     168    PRIMARY KEY (time_id) 
    163169); 
    164170 
     
    167173    fee_id serial NOT NULL, 
    168174    fee text NOT NULL, 
    169     pref int2 
     175    pref int2, 
     176    PRIMARY KEY (fee_id) 
    170177); 
    171178 
     
    200207    memo08 text, 
    201208    memo09 text, 
    202     memo10 text 
     209    memo10 text, 
     210    PRIMARY KEY (payment_id) 
    203211); 
    204212 
     
    215223 
    216224CREATE TABLE dtb_mailmaga_template ( 
    217     template_id serial NOT NULL UNIQUE, 
     225    template_id serial NOT NULL, 
    218226    subject text, 
    219227    charge_image text, 
     
    241249    creator_id int4 NOT NULL, 
    242250    create_date timestamp NOT NULL DEFAULT now(), 
    243     update_date timestamp 
     251    update_date timestamp, 
     252    PRIMARY KEY (template_id) 
    244253); 
    245254 
     
    257266    creator_id int4 NOT NULL, 
    258267    create_date timestamp NOT NULL DEFAULT now(), 
    259     update_date timestamp NOT NULL DEFAULT now() 
     268    update_date timestamp NOT NULL DEFAULT now(), 
     269    PRIMARY KEY (send_id) 
    260270); 
    261271 
     
    269279 
    270280CREATE TABLE dtb_products ( 
    271     product_id serial NOT NULL UNIQUE, 
     281    product_id serial NOT NULL, 
    272282    name text, 
    273283    deliv_fee numeric, 
     
    326336    create_date timestamp NOT NULL DEFAULT now(), 
    327337    update_date timestamp, 
    328     deliv_date_id int4 
     338    deliv_date_id int4, 
     339    PRIMARY KEY (product_id) 
    329340); 
    330341 
    331342CREATE TABLE dtb_products_class ( 
    332     product_class_id serial NOT NULL UNIQUE, 
     343    product_class_id serial NOT NULL, 
    333344    product_id int4 NOT NULL, 
    334345    classcategory_id1 int4 NOT NULL DEFAULT 0, 
     
    343354    creator_id int4 NOT NULL, 
    344355    create_date timestamp NOT NULL DEFAULT now(), 
    345     update_date timestamp 
     356    update_date timestamp, 
     357    PRIMARY KEY (product_class_id) 
    346358); 
    347359 
     
    354366    create_date timestamp NOT NULL DEFAULT now(), 
    355367    update_date timestamp, 
    356     del_flg  int2 NOT NULL DEFAULT 0, 
    357     product_id int4 
     368    del_flg int2 NOT NULL DEFAULT 0, 
     369    product_id int4, 
     370    PRIMARY KEY (class_id) 
    358371); 
    359372 
     
    367380    create_date timestamp NOT NULL DEFAULT now(), 
    368381    update_date timestamp, 
    369     del_flg  int2 NOT NULL DEFAULT 0 
     382    del_flg int2 NOT NULL DEFAULT 0, 
     383    PRIMARY KEY (classcategory_id) 
    370384); 
    371385 
     
    379393    create_date timestamp NOT NULL DEFAULT now(), 
    380394    update_date timestamp, 
    381     del_flg  int2 NOT NULL DEFAULT 0 
     395    del_flg int2 NOT NULL DEFAULT 0 
    382396); 
    383397 
     
    455469    create_date timestamp NOT NULL DEFAULT now(), 
    456470    update_date timestamp, 
    457     del_flg  int2 NOT NULL DEFAULT 0 
     471    del_flg int2 NOT NULL DEFAULT 0, 
     472    PRIMARY KEY (review_id) 
    458473); 
    459474 
     
    486501 
    487502CREATE TABLE dtb_news ( 
    488     news_id serial NOT NULL UNIQUE, 
     503    news_id serial NOT NULL, 
    489504    news_date timestamp, 
    490505    rank int4, 
     
    497512    create_date timestamp NOT NULL DEFAULT now(), 
    498513    update_date timestamp, 
    499     del_flg  int2 NOT NULL DEFAULT 0 
     514    del_flg int2 NOT NULL DEFAULT 0, 
     515    PRIMARY KEY (news_id) 
    500516); 
    501517 
     
    510526    create_date timestamp NOT NULL DEFAULT now(), 
    511527    update_date timestamp, 
    512     del_flg  int2 NOT NULL DEFAULT 0 
     528    del_flg int2 NOT NULL DEFAULT 0, 
     529    PRIMARY KEY (best_id) 
    513530); 
    514531 
     
    520537    creator_id int4 NOT NULL, 
    521538    subject text, 
    522     mail_body text 
     539    mail_body text, 
     540    PRIMARY KEY (send_id) 
    523541); 
    524542 
     
    558576    create_date timestamp NOT NULL DEFAULT now(), 
    559577    update_date timestamp DEFAULT now(), 
    560     del_flg  int2 NOT NULL DEFAULT 0, 
     578    del_flg int2 NOT NULL DEFAULT 0, 
    561579    cell01 text, 
    562580    cell02 text, 
    563581    cell03 text, 
    564582    mobile_phone_id text, 
    565     mailmaga_flg int2 
     583    mailmaga_flg int2, 
     584    PRIMARY KEY (customer_id) 
    566585); 
    567586 
     
    571590    email text NOT NULL UNIQUE, 
    572591    mail_flag int2, 
    573     temp_id text NOT NULL UNIQUE, 
     592    temp_id text NOT NULL, 
    574593    end_flag int2, 
    575594    update_date timestamp NOT NULL DEFAULT Now(), 
    576     create_data timestamp NOT NULL DEFAULT Now() 
     595    create_data timestamp NOT NULL DEFAULT Now(), 
     596    PRIMARY KEY (temp_id) 
    577597); 
    578598 
     
    640660    update_date timestamp, 
    641661    commit_date timestamp, 
    642     del_flg  int2 NOT NULL DEFAULT 0, 
     662    del_flg int2 NOT NULL DEFAULT 0, 
    643663    deliv_date text, 
    644664    conveni_data text, 
     
    656676    memo09 text, 
    657677    memo10 text, 
    658     campaign_id int4 
     678    campaign_id int4, 
     679    PRIMARY KEY (order_id) 
    659680); 
    660681 
     
    723744    create_date timestamp NOT NULL DEFAULT now(), 
    724745    update_date timestamp, 
    725     del_flg  int2 NOT NULL DEFAULT 0, 
     746    del_flg int2 NOT NULL DEFAULT 0, 
    726747    deliv_date text, 
    727748    conveni_data text, 
     
    757778    tel01 text, 
    758779    tel02 text, 
    759     tel03 text 
     780    tel03 text, 
     781    PRIMARY KEY (other_deliv_id) 
    760782); 
    761783 
     
    794816    update_date timestamp, 
    795817    create_date timestamp NOT NULL DEFAULT now(), 
    796     login_date timestamp 
     818    login_date timestamp, 
     819    PRIMARY KEY (member_id) 
    797820); 
    798821 
     
    802825    question text, 
    803826    create_date timestamp NOT NULL DEFAULT now(), 
    804     del_flg  int2 NOT NULL DEFAULT 0 
     827    del_flg int2 NOT NULL DEFAULT 0, 
     828    PRIMARY KEY (question_id) 
    805829); 
    806830 
     
    830854    question06 text, 
    831855    create_date timestamp NOT NULL DEFAULT now(), 
    832     del_flg  int2 NOT NULL DEFAULT 0 
     856    del_flg int2 NOT NULL DEFAULT 0, 
     857    PRIMARY KEY (result_id) 
    833858); 
    834859 
     
    856881    del_flg int2 NOT NULL DEFAULT 0, 
    857882    create_date timestamp NOT NULL, 
    858     update_date timestamp NOT NULL DEFAULT now() 
     883    update_date timestamp NOT NULL DEFAULT now(), 
     884    PRIMARY KEY (campaign_id) 
    859885); 
    860886 
     
    880906    update_url text, 
    881907    create_date timestamp NOT NULL DEFAULT now(), 
    882     update_date timestamp NOT NULL DEFAULT now() 
     908    update_date timestamp NOT NULL DEFAULT now(), 
     909    PRIMARY KEY (page_id) 
    883910); 
    884911 
     
    891918    update_date timestamp NOT NULL DEFAULT now(), 
    892919    php_path text, 
    893     del_flg int2 NOT NULL DEFAULT 0 
     920    del_flg int2 NOT NULL DEFAULT 0, 
     921    PRIMARY KEY (bloc_id) 
    894922); 
    895923 
     
    910938    status int2 NOT NULL DEFAULT 1, 
    911939    create_date timestamp NOT NULL DEFAULT now(), 
    912     update_date timestamp NOT NULL DEFAULT now() 
     940    update_date timestamp NOT NULL DEFAULT now(), 
     941    PRIMARY KEY (no) 
    913942); 
    914943 
     
    918947    csv_sql text, 
    919948    update_date timestamp NOT NULL DEFAULT now(), 
    920     create_date timestamp NOT NULL DEFAULT now() 
     949    create_date timestamp NOT NULL DEFAULT now(), 
     950    PRIMARY KEY (sql_id) 
    921951); 
    922952 
     
    936966    del_flg int2 DEFAULT 0, 
    937967    create_date timestamp NOT NULL, 
    938     update_date timestamp NOT NULL DEFAULT now() 
    939 ); 
    940  
    941 create table dtb_templates 
    942 ( 
    943 template_code        text        NOT NULL UNIQUE    , 
    944 template_name        text            , 
    945 create_date        timestamp        NOT NULL    default now(), 
    946 update_date        timestamp        NOT NULL    default now() 
    947 ); 
    948  
    949 create table dtb_table_comment 
    950 ( 
    951 id    serial, 
    952 table_name    text, 
    953 column_name    text, 
    954 description    text 
     968    update_date timestamp NOT NULL DEFAULT now(), 
     969    PRIMARY KEY (user_id) 
     970); 
     971 
     972create table dtb_templates ( 
     973    template_code        text        NOT NULL, 
     974    template_name        text            , 
     975    create_date        timestamp        NOT NULL    default now(), 
     976    update_date        timestamp        NOT NULL    default now(), 
     977    PRIMARY KEY (template_code) 
     978); 
     979 
     980create table dtb_table_comment ( 
     981    id    serial, 
     982    table_name    text, 
     983    column_name    text, 
     984    description    text, 
     985    PRIMARY KEY (id) 
    955986); 
    956987 
     
    962993    create_date timestamp NOT NULL DEFAULT now(), 
    963994    update_date timestamp NOT NULL, 
    964     del_flg  int2 NOT NULL DEFAULT 0 
     995    del_flg int2 NOT NULL DEFAULT 0, 
     996    PRIMARY KEY (maker_id) 
    965997); 
    966998 
Note: See TracChangeset for help on using the changeset viewer.