Ignore:
Timestamp:
2009/10/15 23:53:18 (15 years ago)
Author:
Seasoft
Message:

MySQL用とPostgreSQL用で、極力記述を揃えた。

File:
1 edited

Legend:

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

    r18275 r18331  
    11create table dtb_module_update_logs( 
    2     log_id int auto_increment primary key NOT NULL, 
    3     module_id int not null, 
     2    log_id int auto_increment NOT NULL, 
     3    module_id int NOT NULL, 
    44    buckup_path text, 
    55    error_flg smallint DEFAULT 0, 
     
    77    ok text, 
    88    create_date datetime NOT NULL, 
    9     update_date datetime NOT NULL 
    10 ) TYPE=InnoDB ; 
     9    update_date datetime NOT NULL, 
     10    PRIMARY KEY (log_id) 
     11) TYPE=InnoDB; 
    1112 
    1213CREATE TABLE dtb_ownersstore_settings ( 
    1314    public_key text 
    14 ) TYPE=InnoDB ; 
     15) TYPE=InnoDB; 
    1516 
    1617CREATE TABLE dtb_kiyaku ( 
    17     kiyaku_id int auto_increment primary key NOT NULL, 
     18    kiyaku_id int auto_increment NOT NULL, 
    1819    kiyaku_title text NOT NULL, 
    1920    kiyaku_text text NOT NULL, 
    2021    rank int NOT NULL DEFAULT 0, 
    2122    creator_id int NOT NULL, 
    22     create_date datetime NOT NULL , 
     23    create_date datetime NOT NULL, 
    2324    update_date datetime NOT NULL, 
    24     del_flg smallint NOT NULL DEFAULT 0 
    25 ) TYPE=InnoDB ; 
     25    del_flg smallint NOT NULL DEFAULT 0, 
     26    PRIMARY KEY (kiyaku_id) 
     27) TYPE=InnoDB; 
    2628 
    2729CREATE TABLE dtb_holiday ( 
    28     holiday_id int auto_increment primary key NOT NULL, 
     30    holiday_id int auto_increment NOT NULL, 
    2931    title text NOT NULL, 
    3032    month smallint NOT NULL, 
     
    3436    create_date datetime NOT NULL, 
    3537    update_date datetime NOT NULL, 
    36     del_flg smallint NOT NULL DEFAULT 0 
    37 ) TYPE=InnoDB ; 
     38    del_flg smallint NOT NULL DEFAULT 0, 
     39    PRIMARY KEY (holiday_id) 
     40) TYPE=InnoDB; 
    3841 
    3942CREATE TABLE mtb_zip ( 
     
    5356    flg5 text, 
    5457    flg6 text 
    55 ) TYPE=InnoDB ; 
     58) TYPE=InnoDB; 
    5659 
    5760CREATE TABLE dtb_bat_order_daily_age ( 
     
    6467    order_date datetime, 
    6568    create_date datetime NOT NULL 
    66 ) TYPE=InnoDB ; 
     69) TYPE=InnoDB; 
    6770 
    6871CREATE TABLE dtb_update ( 
     
    7881    other_files text, 
    7982    del_flg smallint NOT NULL DEFAULT 0, 
    80     create_date datetime NOT NULL , 
     83    create_date datetime NOT NULL, 
    8184    update_date datetime, 
    8285    release_date datetime NOT NULL, 
    8386    PRIMARY KEY (module_id) 
    84 ) TYPE=InnoDB ; 
     87) TYPE=InnoDB; 
    8588 
    8689CREATE TABLE dtb_baseinfo ( 
     
    144147    message text, 
    145148    regular_holiday_ids text 
    146 ) TYPE=InnoDB ; 
     149) TYPE=InnoDB; 
    147150 
    148151CREATE TABLE dtb_deliv ( 
    149     deliv_id int auto_increment primary key NOT NULL, 
     152    deliv_id int auto_increment NOT NULL, 
    150153    name text, 
    151154    service_name text, 
     
    155158    del_flg smallint NOT NULL DEFAULT 0, 
    156159    creator_id int NOT NULL, 
    157     create_date datetime NOT NULL , 
    158     update_date datetime 
    159 ) TYPE=InnoDB ; 
     160    create_date datetime NOT NULL, 
     161    update_date datetime, 
     162    PRIMARY KEY (deliv_id) 
     163) TYPE=InnoDB; 
    160164 
    161165CREATE TABLE dtb_delivtime ( 
     
    164168    deliv_time text NOT NULL, 
    165169    PRIMARY KEY (deliv_id, time_id) 
    166 ) TYPE=InnoDB ; 
     170) TYPE=InnoDB; 
    167171 
    168172CREATE TABLE dtb_delivfee ( 
    169173    deliv_id int NOT NULL, 
    170     fee_id int auto_increment primary key NOT NULL, 
     174    fee_id int auto_increment NOT NULL, 
    171175    fee text NOT NULL, 
    172     pref smallint 
    173 ) TYPE=InnoDB ; 
     176    pref smallint, 
     177    PRIMARY KEY (fee_id) 
     178) TYPE=InnoDB; 
    174179 
    175180CREATE TABLE dtb_payment ( 
    176     payment_id int auto_increment primary key NOT NULL, 
     181    payment_id int auto_increment NOT NULL, 
    177182    payment_method text, 
    178183    charge numeric, 
     
    185190    del_flg smallint NOT NULL DEFAULT 0, 
    186191    creator_id int NOT NULL, 
    187     create_date datetime NOT NULL , 
     192    create_date datetime NOT NULL, 
    188193    update_date datetime, 
    189194    payment_image text, 
    190195    upper_rule numeric, 
    191     charge_flg int2 DEFAULT 1, 
     196    charge_flg smallint DEFAULT 1, 
    192197    rule_min numeric, 
    193198    upper_rule_max numeric, 
    194     module_id int4, 
     199    module_id int, 
    195200    module_path text, 
    196201    memo01 text, 
     
    203208    memo08 text, 
    204209    memo09 text, 
    205     memo10 text 
    206 ) TYPE=InnoDB ; 
     210    memo10 text, 
     211    PRIMARY KEY (payment_id) 
     212) TYPE=InnoDB; 
    207213 
    208214CREATE TABLE dtb_mailtemplate ( 
     
    213219    creator_id int NOT NULL, 
    214220    del_flg smallint NOT NULL DEFAULT 0, 
    215     create_date datetime NOT NULL , 
     221    create_date datetime NOT NULL, 
    216222    update_date datetime NOT NULL 
    217 ) TYPE=InnoDB ; 
     223) TYPE=InnoDB; 
    218224 
    219225CREATE TABLE dtb_mailmaga_template ( 
    220     template_id int auto_increment primary key NOT NULL, 
     226    template_id int auto_increment NOT NULL, 
    221227    subject text, 
    222228    charge_image text, 
     
    243249    del_flg smallint NOT NULL DEFAULT 0, 
    244250    creator_id int NOT NULL, 
    245     create_date datetime NOT NULL , 
    246     update_date datetime 
    247 ) TYPE=InnoDB ; 
     251    create_date datetime NOT NULL, 
     252    update_date datetime, 
     253    PRIMARY KEY (template_id) 
     254) TYPE=InnoDB; 
    248255 
    249256CREATE TABLE dtb_send_history ( 
    250     send_id int auto_increment primary key NOT NULL, 
     257    send_id int auto_increment NOT NULL, 
    251258    mail_method smallint, 
    252259    subject text, 
     
    259266    del_flg smallint NOT NULL DEFAULT 0, 
    260267    creator_id int NOT NULL, 
    261     create_date datetime NOT NULL , 
    262     update_date datetime NOT NULL 
    263 ) TYPE=InnoDB ; 
     268    create_date datetime NOT NULL, 
     269    update_date datetime NOT NULL, 
     270    PRIMARY KEY (send_id) 
     271) TYPE=InnoDB; 
    264272 
    265273CREATE TABLE dtb_send_customer ( 
     
    269277    name text, 
    270278    send_flag smallint 
    271 ) TYPE=InnoDB ; 
     279) TYPE=InnoDB; 
    272280 
    273281CREATE TABLE dtb_products ( 
    274     product_id int auto_increment primary key NOT NULL, 
     282    product_id int auto_increment NOT NULL, 
    275283    name text, 
    276284    deliv_fee numeric, 
     
    326334    del_flg smallint NOT NULL DEFAULT 0, 
    327335    creator_id int NOT NULL, 
    328     create_date datetime NOT NULL , 
    329     update_date datetime, 
    330     deliv_date_id int 
    331 ) TYPE=InnoDB ; 
     336    create_date datetime NOT NULL, 
     337    update_date datetime, 
     338    deliv_date_id int, 
     339    PRIMARY KEY (product_id) 
     340) TYPE=InnoDB; 
    332341 
    333342CREATE TABLE dtb_products_class ( 
    334     product_class_id int auto_increment primary key NOT NULL, 
     343    product_class_id int auto_increment NOT NULL, 
    335344    product_id int NOT NULL, 
    336345    classcategory_id1 int NOT NULL DEFAULT 0, 
     
    344353    status smallint, 
    345354    creator_id int NOT NULL, 
    346     create_date datetime NOT NULL , 
    347     update_date datetime 
    348 ) TYPE=InnoDB ; 
     355    create_date datetime NOT NULL, 
     356    update_date datetime, 
     357    PRIMARY KEY (product_class_id) 
     358) TYPE=InnoDB; 
    349359 
    350360CREATE TABLE dtb_class ( 
    351     class_id int auto_increment primary key NOT NULL, 
     361    class_id int auto_increment NOT NULL, 
    352362    name text, 
    353363    status smallint, 
    354364    rank int, 
    355365    creator_id int NOT NULL, 
    356     create_date datetime NOT NULL , 
    357     update_date datetime, 
    358     del_flg smallint NOT NULL DEFAULT 0, 
    359     product_id int 
    360 ) TYPE=InnoDB ; 
     366    create_date datetime NOT NULL, 
     367    update_date datetime, 
     368    del_flg smallint NOT NULL DEFAULT 0, 
     369    product_id int, 
     370    PRIMARY KEY (class_id) 
     371) TYPE=InnoDB; 
    361372 
    362373CREATE TABLE dtb_classcategory ( 
    363     classcategory_id int auto_increment primary key NOT NULL, 
     374    classcategory_id int auto_increment NOT NULL, 
    364375    name text, 
    365376    class_id int NOT NULL, 
     
    367378    rank int, 
    368379    creator_id int NOT NULL, 
    369     create_date datetime NOT NULL , 
    370     update_date datetime, 
    371     del_flg smallint NOT NULL DEFAULT 0 
    372 ) TYPE=InnoDB ; 
     380    create_date datetime NOT NULL, 
     381    update_date datetime, 
     382    del_flg smallint NOT NULL DEFAULT 0, 
     383    PRIMARY KEY (classcategory_id) 
     384) TYPE=InnoDB; 
    373385 
    374386CREATE TABLE dtb_category ( 
    375     category_id int auto_increment primary key NOT NULL, 
     387    category_id int auto_increment NOT NULL, 
    376388    category_name text, 
    377389    parent_category_id int NOT NULL DEFAULT 0, 
     
    379391    rank int, 
    380392    creator_id int NOT NULL, 
    381     create_date datetime NOT NULL , 
    382     update_date datetime, 
    383     del_flg smallint NOT NULL DEFAULT 0 
    384 ) TYPE=InnoDB ; 
     393    create_date datetime NOT NULL, 
     394    update_date datetime, 
     395    del_flg smallint NOT NULL DEFAULT 0, 
     396    PRIMARY KEY (category_id) 
     397) TYPE=InnoDB; 
    385398 
    386399CREATE TABLE dtb_product_categories ( 
    387     product_id int4 NOT NULL, 
    388     category_id int4 NOT NULL, 
    389     rank int4 NOT NULL, 
     400    product_id int NOT NULL, 
     401    category_id int NOT NULL, 
     402    rank int NOT NULL, 
    390403    PRIMARY KEY(product_id, category_id) 
    391404) TYPE=InnoDB; 
     
    403416    total numeric NOT NULL DEFAULT 0, 
    404417    total_average numeric NOT NULL DEFAULT 0, 
    405     order_date datetime NOT NULL , 
    406     create_date datetime NOT NULL , 
     418    order_date datetime NOT NULL, 
     419    create_date datetime NOT NULL, 
    407420    year smallint NOT NULL, 
    408421    month smallint NOT NULL, 
     
    413426    key_year text NOT NULL, 
    414427    key_wday text NOT NULL 
    415 ) TYPE=InnoDB ; 
     428) TYPE=InnoDB; 
    416429 
    417430CREATE TABLE dtb_bat_order_daily_hour ( 
     
    428441    total_average numeric NOT NULL DEFAULT 0, 
    429442    hour smallint NOT NULL DEFAULT 0, 
    430     order_date datetime , 
     443    order_date datetime, 
    431444    create_date datetime NOT NULL 
    432 ) TYPE=InnoDB ; 
     445) TYPE=InnoDB; 
    433446 
    434447CREATE TABLE dtb_recommend_products ( 
     
    439452    status smallint NOT NULL DEFAULT 0, 
    440453    creator_id int NOT NULL, 
    441     create_date datetime NOT NULL , 
     454    create_date datetime NOT NULL, 
    442455    update_date datetime NOT NULL 
    443 ) TYPE=InnoDB ; 
     456) TYPE=InnoDB; 
    444457 
    445458CREATE TABLE dtb_review ( 
    446     review_id int auto_increment primary key NOT NULL, 
     459    review_id int auto_increment NOT NULL, 
    447460    product_id int NOT NULL, 
    448461    reviewer_name text NOT NULL, 
     
    457470    create_date datetime, 
    458471    update_date datetime, 
    459     del_flg smallint NOT NULL DEFAULT 0 
    460 ) TYPE=InnoDB ; 
     472    del_flg smallint NOT NULL DEFAULT 0, 
     473    PRIMARY KEY (review_id) 
     474) TYPE=InnoDB; 
    461475 
    462476CREATE TABLE dtb_customer_reading ( 
     
    465479    create_date datetime NOT NULL, 
    466480    update_date datetime NOT NULL 
    467 ) TYPE=InnoDB ; 
     481) TYPE=InnoDB; 
    468482 
    469483CREATE TABLE dtb_customer_favorite_products ( 
     
    472486    create_date datetime NOT NULL, 
    473487    update_date datetime NOT NULL 
    474 ) TYPE=InnoDB ; 
     488) TYPE=InnoDB; 
    475489 
    476490CREATE TABLE dtb_category_count ( 
     
    478492    product_count int NOT NULL, 
    479493    create_date datetime NOT NULL 
    480 ) TYPE=InnoDB ; 
     494) TYPE=InnoDB; 
    481495 
    482496CREATE TABLE dtb_category_total_count ( 
     
    484498    product_count int, 
    485499    create_date datetime NOT NULL 
    486 ) TYPE=InnoDB ; 
     500) TYPE=InnoDB; 
    487501 
    488502CREATE TABLE dtb_news ( 
    489     news_id int auto_increment primary key NOT NULL, 
     503    news_id int auto_increment NOT NULL, 
    490504    news_date datetime, 
    491505    rank int, 
     
    496510    link_method text, 
    497511    creator_id int NOT NULL, 
    498     create_date datetime NOT NULL , 
    499     update_date datetime, 
    500     del_flg smallint NOT NULL DEFAULT 0 
    501 ) TYPE=InnoDB ; 
     512    create_date datetime NOT NULL, 
     513    update_date datetime, 
     514    del_flg smallint NOT NULL DEFAULT 0, 
     515    PRIMARY KEY (news_id) 
     516) TYPE=InnoDB; 
    502517 
    503518CREATE TABLE dtb_best_products ( 
    504     best_id int auto_increment primary key NOT NULL, 
     519    best_id int auto_increment NOT NULL, 
    505520    category_id int NOT NULL, 
    506521    rank int NOT NULL DEFAULT 0, 
     
    509524    comment text, 
    510525    creator_id int NOT NULL, 
    511     create_date datetime NOT NULL , 
    512     update_date datetime, 
    513     del_flg smallint NOT NULL DEFAULT 0 
    514 ) TYPE=InnoDB ; 
     526    create_date datetime NOT NULL, 
     527    update_date datetime, 
     528    del_flg smallint NOT NULL DEFAULT 0, 
     529    PRIMARY KEY (best_id) 
     530) TYPE=InnoDB; 
    515531 
    516532CREATE TABLE dtb_mail_history ( 
    517     send_id int auto_increment primary key  NOT NULL, 
     533    send_id int auto_increment NOT NULL, 
    518534    order_id int NOT NULL, 
    519535    send_date datetime, 
     
    521537    creator_id int NOT NULL, 
    522538    subject text, 
    523     mail_body text 
    524 ) TYPE=InnoDB ; 
     539    mail_body text, 
     540    PRIMARY KEY (send_id) 
     541) TYPE=InnoDB; 
    525542 
    526543CREATE TABLE dtb_customer ( 
    527     customer_id int auto_increment primary key  NOT NULL, 
     544    customer_id int auto_increment NOT NULL, 
    528545    name01 text NOT NULL, 
    529546    name02 text NOT NULL, 
     
    557574    note text, 
    558575    status smallint NOT NULL DEFAULT 1, 
    559     create_date datetime NOT NULL , 
    560     update_date datetime , 
     576    create_date datetime NOT NULL, 
     577    update_date datetime, 
    561578    del_flg smallint NOT NULL DEFAULT 0, 
    562579    cell01 text, 
     
    564581    cell03 text, 
    565582    mobile_phone_id text, 
    566     mailmaga_flg smallint 
    567 ) TYPE=InnoDB ; 
     583    mailmaga_flg smallint, 
     584    PRIMARY KEY (customer_id) 
     585) TYPE=InnoDB; 
    568586 
    569587CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64)); 
     
    577595    create_data datetime NOT NULL, 
    578596    PRIMARY KEY (temp_id) 
    579 ) TYPE=InnoDB ; 
     597) TYPE=InnoDB; 
    580598 
    581599CREATE TABLE dtb_order ( 
    582     order_id int auto_increment primary key NOT NULL, 
     600    order_id int auto_increment NOT NULL, 
    583601    order_temp_id text, 
    584602    customer_id int NOT NULL, 
     
    636654    note text, 
    637655    status smallint, 
    638     create_date datetime NOT NULL , 
     656    create_date datetime NOT NULL, 
    639657    loan_result text, 
    640658    credit_result text, 
     
    658676    memo09 text, 
    659677    memo10 text, 
    660     campaign_id int 
    661 ) TYPE=InnoDB ; 
     678    campaign_id int, 
     679    PRIMARY KEY (order_id) 
     680) TYPE=InnoDB; 
    662681 
    663682CREATE TABLE dtb_order_temp ( 
     
    723742    credit_result text, 
    724743    credit_msg text, 
    725     create_date datetime NOT NULL , 
     744    create_date datetime NOT NULL, 
    726745    update_date datetime, 
    727746    del_flg smallint NOT NULL DEFAULT 0, 
     
    731750    cell02 text, 
    732751    cell03 text, 
    733     order_id int4, 
     752    order_id int, 
    734753    memo01 text, 
    735754    memo02 text, 
     
    743762    memo10 text, 
    744763    session text 
    745 ) TYPE=InnoDB ; 
     764) TYPE=InnoDB; 
    746765 
    747766CREATE TABLE dtb_other_deliv ( 
    748     other_deliv_id int auto_increment primary key NOT NULL, 
     767    other_deliv_id int auto_increment NOT NULL, 
    749768    customer_id int NOT NULL, 
    750769    name01 text, 
     
    759778    tel01 text, 
    760779    tel02 text, 
    761     tel03 text 
    762 ) TYPE=InnoDB ; 
     780    tel03 text, 
     781    PRIMARY KEY (other_deliv_id) 
     782) TYPE=InnoDB; 
    763783 
    764784CREATE TABLE dtb_order_detail ( 
     
    774794    quantity numeric, 
    775795    point_rate numeric 
    776 ) TYPE=InnoDB ; 
     796) TYPE=InnoDB; 
    777797 
    778798CREATE TABLE mtb_pref ( 
    779     pref_id smallint primary key NOT NULL, 
     799    pref_id smallint NOT NULL, 
    780800    pref_name text, 
    781     rank smallint NOT NULL DEFAULT 0 
    782 ) TYPE=InnoDB ; 
     801    rank smallint NOT NULL DEFAULT 0, 
     802    PRIMARY KEY (pref_id) 
     803) TYPE=InnoDB; 
    783804 
    784805CREATE TABLE dtb_member ( 
    785     member_id int auto_increment primary key NOT NULL, 
     806    member_id int auto_increment NOT NULL, 
    786807    name text, 
    787808    department text, 
     
    794815    creator_id int NOT NULL, 
    795816    update_date datetime, 
    796     create_date datetime NOT NULL , 
    797     login_date datetime 
    798 ) TYPE=InnoDB ; 
     817    create_date datetime NOT NULL, 
     818    login_date datetime, 
     819    PRIMARY KEY (member_id) 
     820) TYPE=InnoDB; 
    799821 
    800822CREATE TABLE dtb_question ( 
    801     question_id int auto_increment primary key NOT NULL, 
     823    question_id int auto_increment NOT NULL, 
    802824    question_name text, 
    803825    question text, 
    804     create_date datetime NOT NULL , 
    805     del_flg smallint NOT NULL DEFAULT 0 
    806 ) TYPE=InnoDB ; 
     826    create_date datetime NOT NULL, 
     827    del_flg smallint NOT NULL DEFAULT 0, 
     828    PRIMARY KEY (question_id) 
     829) TYPE=InnoDB; 
    807830 
    808831CREATE TABLE dtb_question_result ( 
    809     result_id int auto_increment primary key NOT NULL, 
     832    result_id int auto_increment NOT NULL, 
    810833    question_id int NOT NULL, 
    811834    question_date datetime, 
     
    830853    question05 text, 
    831854    question06 text, 
    832     create_date datetime NOT NULL , 
    833     del_flg smallint NOT NULL DEFAULT 0 
    834 ) TYPE=InnoDB ; 
     855    create_date datetime NOT NULL, 
     856    del_flg smallint NOT NULL DEFAULT 0, 
     857    PRIMARY KEY (result_id) 
     858) TYPE=InnoDB; 
    835859 
    836860CREATE TABLE dtb_bat_relate_products ( 
     
    839863    customer_id int, 
    840864    create_date datetime 
    841 ) TYPE=InnoDB ; 
     865) TYPE=InnoDB; 
    842866 
    843867CREATE TABLE dtb_campaign ( 
    844     campaign_id int auto_increment primary key NOT NULL, 
     868    campaign_id int auto_increment NOT NULL, 
    845869    campaign_name text, 
    846870    campaign_point_rate numeric NOT NULL, 
     
    849873    end_date datetime NOT NULL, 
    850874    directory_name text NOT NULL, 
    851     limit_count int4 NOT NULL DEFAULT 0, 
    852     total_count int4 NOT NULL DEFAULT 0, 
    853     orverlapping_flg int2 NOT NULL DEFAULT 0, 
    854     cart_flg int2 NOT NULL DEFAULT 0, 
    855     deliv_free_flg int2 NOT NULL DEFAULT 0, 
     875    limit_count int NOT NULL DEFAULT 0, 
     876    total_count int NOT NULL DEFAULT 0, 
     877    orverlapping_flg smallint NOT NULL DEFAULT 0, 
     878    cart_flg smallint NOT NULL DEFAULT 0, 
     879    deliv_free_flg smallint NOT NULL DEFAULT 0, 
    856880    search_condition text, 
    857881    del_flg smallint NOT NULL DEFAULT 0, 
    858882    create_date datetime NOT NULL, 
    859     update_date datetime NOT NULL 
    860 ) TYPE=InnoDB ; 
     883    update_date datetime NOT NULL, 
     884    PRIMARY KEY (campaign_id) 
     885) TYPE=InnoDB; 
    861886 
    862887CREATE TABLE dtb_campaign_detail ( 
     
    864889    product_id int NOT NULL, 
    865890    campaign_point_rate numeric NOT NULL 
    866 ) TYPE=InnoDB ; 
     891) TYPE=InnoDB; 
    867892 
    868893CREATE TABLE dtb_pagelayout ( 
    869     page_id int auto_increment primary key NOT NULL, 
     894    page_id int auto_increment NOT NULL, 
    870895    page_name text, 
    871896    url text NOT NULL, 
     
    880905    keyword text, 
    881906    update_url text, 
    882     create_date datetime NOT NULL , 
    883     update_date datetime NOT NULL 
    884 ) TYPE=InnoDB ; 
     907    create_date datetime NOT NULL, 
     908    update_date datetime NOT NULL, 
     909    PRIMARY KEY (page_id) 
     910) TYPE=InnoDB; 
    885911 
    886912CREATE TABLE dtb_bloc ( 
    887     bloc_id int auto_increment primary key NOT NULL, 
     913    bloc_id int auto_increment NOT NULL, 
    888914    bloc_name text, 
    889915    tpl_path text, 
    890916    filename varchar(50) NOT NULL UNIQUE, 
    891     create_date datetime NOT NULL , 
    892     update_date datetime NOT NULL , 
     917    create_date datetime NOT NULL, 
     918    update_date datetime NOT NULL, 
    893919    php_path text, 
    894     del_flg smallint NOT NULL DEFAULT 0 
    895 ) TYPE=InnoDB ; 
     920    del_flg smallint NOT NULL DEFAULT 0, 
     921    PRIMARY KEY (bloc_id) 
     922) TYPE=InnoDB; 
    896923 
    897924CREATE TABLE dtb_blocposition ( 
     
    902929    filename text, 
    903930    anywhere int DEFAULT 0 NOT NULL 
    904 ) TYPE=InnoDB ; 
     931) TYPE=InnoDB; 
    905932 
    906933CREATE TABLE dtb_csv ( 
    907     no int auto_increment primary key, 
     934    no int auto_increment, 
    908935    csv_id int NOT NULL, 
    909936    col text, 
     
    911938    rank int, 
    912939    status smallint NOT NULL DEFAULT 1, 
    913     create_date datetime NOT NULL , 
    914     update_date datetime NOT NULL 
    915 ) TYPE=InnoDB ; 
     940    create_date datetime NOT NULL, 
     941    update_date datetime NOT NULL, 
     942    PRIMARY KEY (no) 
     943) TYPE=InnoDB; 
    916944 
    917945CREATE TABLE dtb_csv_sql ( 
    918     sql_id int auto_increment primary key, 
     946    sql_id int auto_increment, 
    919947    sql_name text NOT NULL, 
    920948    csv_sql text, 
    921949    update_date datetime NOT NULL, 
    922     create_date datetime NOT NULL 
    923 ) TYPE=InnoDB ; 
     950    create_date datetime NOT NULL, 
     951    PRIMARY KEY (sql_id) 
     952) TYPE=InnoDB; 
    924953 
    925954CREATE TABLE dtb_user_regist ( 
    926     user_id int auto_increment primary key NOT NULL, 
     955    user_id int auto_increment NOT NULL, 
    927956    org_name text, 
    928957    post_name text, 
     
    938967    del_flg smallint DEFAULT 0, 
    939968    create_date datetime NOT NULL, 
    940     update_date datetime NOT NULL 
    941 ) TYPE=InnoDB ; 
     969    update_date datetime NOT NULL, 
     970    PRIMARY KEY (user_id) 
     971) TYPE=InnoDB; 
    942972 
    943973CREATE TABLE dtb_templates 
    944974( 
    945     template_code        varchar(50) primary key NOT NULL, 
    946     template_name        text            , 
    947     create_date        datetime        NOT NULL    , 
    948     update_date        datetime        NOT NULL 
    949 ) TYPE=InnoDB ; 
     975    template_code varchar(50) NOT NULL, 
     976    template_name text, 
     977    create_date datetime NOT NULL, 
     978    update_date datetime NOT NULL, 
     979    PRIMARY KEY (template_code) 
     980) TYPE=InnoDB; 
    950981 
    951982CREATE TABLE dtb_table_comment 
    952983( 
    953     id    int auto_increment primary key, 
    954     table_name    text, 
    955     column_name    text, 
    956     description    text 
    957 ) TYPE=InnoDB ; 
     984    id int auto_increment, 
     985    table_name text, 
     986    column_name text, 
     987    description text, 
     988    PRIMARY KEY (id) 
     989) TYPE=InnoDB; 
    958990 
    959991CREATE TABLE dtb_maker ( 
    960     maker_id INT auto_increment primary key, 
     992    maker_id int auto_increment, 
    961993    name text NOT NULL, 
    962994    rank int NOT NULL DEFAULT 0, 
     
    964996    create_date datetime NOT NULL, 
    965997    update_date datetime NOT NULL, 
    966     del_flg smallint NOT NULL DEFAULT 0 
    967 ) TYPE=InnoDB ; 
     998    del_flg smallint NOT NULL DEFAULT 0, 
     999    PRIMARY KEY (maker_id) 
     1000) TYPE=InnoDB; 
    9681001 
    9691002CREATE TABLE dtb_maker_count ( 
     
    9711004    product_count int NOT NULL, 
    9721005    create_date datetime NOT NULL 
    973 ) TYPE=InnoDB ; 
     1006) TYPE=InnoDB; 
    9741007 
    9751008 
     
    9771010    id text, 
    9781011    name text, 
    979     rank int2 NOT NULL DEFAULT 0, 
     1012    rank smallint NOT NULL DEFAULT 0, 
    9801013    PRIMARY KEY (id(32)) 
    9811014) TYPE=InnoDB; 
    9821015 
    9831016CREATE TABLE mtb_disable_logout ( 
    984     id int2, 
    985     name text, 
    986     rank int2 NOT NULL DEFAULT 0, 
     1017    id smallint, 
     1018    name text, 
     1019    rank smallint NOT NULL DEFAULT 0, 
    9871020    PRIMARY KEY (id) 
    9881021) TYPE=InnoDB; 
    9891022 
    9901023CREATE TABLE mtb_authority ( 
    991     id int2, 
    992     name text, 
    993     rank int2 NOT NULL DEFAULT 0, 
     1024    id smallint, 
     1025    name text, 
     1026    rank smallint NOT NULL DEFAULT 0, 
    9941027    PRIMARY KEY (id) 
    9951028) TYPE=InnoDB; 
    9961029 
    9971030CREATE TABLE mtb_work ( 
    998     id int2, 
    999     name text, 
    1000     rank int2 NOT NULL DEFAULT 0, 
     1031    id smallint, 
     1032    name text, 
     1033    rank smallint NOT NULL DEFAULT 0, 
    10011034    PRIMARY KEY (id) 
    10021035) TYPE=InnoDB; 
    10031036 
    10041037CREATE TABLE mtb_disp ( 
    1005     id int2, 
    1006     name text, 
    1007     rank int2 NOT NULL DEFAULT 0, 
     1038    id smallint, 
     1039    name text, 
     1040    rank smallint NOT NULL DEFAULT 0, 
    10081041    PRIMARY KEY (id) 
    10091042) TYPE=InnoDB; 
    10101043 
    10111044CREATE TABLE mtb_class ( 
    1012     id int2, 
    1013     name text, 
    1014     rank int2 NOT NULL DEFAULT 0, 
     1045    id smallint, 
     1046    name text, 
     1047    rank smallint NOT NULL DEFAULT 0, 
    10151048    PRIMARY KEY (id) 
    10161049) TYPE=InnoDB; 
    10171050 
    10181051CREATE TABLE mtb_srank ( 
    1019     id int2, 
    1020     name text, 
    1021     rank int2 NOT NULL DEFAULT 0, 
     1052    id smallint, 
     1053    name text, 
     1054    rank smallint NOT NULL DEFAULT 0, 
    10221055    PRIMARY KEY (id) 
    10231056) TYPE=InnoDB; 
    10241057 
    10251058CREATE TABLE mtb_status ( 
    1026     id int2, 
    1027     name text, 
    1028     rank int2 NOT NULL DEFAULT 0, 
     1059    id smallint, 
     1060    name text, 
     1061    rank smallint NOT NULL DEFAULT 0, 
    10291062    PRIMARY KEY (id) 
    10301063) TYPE=InnoDB; 
    10311064 
    10321065CREATE TABLE mtb_status_image ( 
    1033     id int2, 
    1034     name text, 
    1035     rank int2 NOT NULL DEFAULT 0, 
     1066    id smallint, 
     1067    name text, 
     1068    rank smallint NOT NULL DEFAULT 0, 
    10361069    PRIMARY KEY (id) 
    10371070) TYPE=InnoDB; 
    10381071 
    10391072CREATE TABLE mtb_allowed_tag ( 
    1040     id int2, 
    1041     name text, 
    1042     rank int2 NOT NULL DEFAULT 0, 
     1073    id smallint, 
     1074    name text, 
     1075    rank smallint NOT NULL DEFAULT 0, 
    10431076    PRIMARY KEY (id) 
    10441077) TYPE=InnoDB; 
    10451078 
    10461079CREATE TABLE mtb_page_max ( 
    1047     id int2, 
    1048     name text, 
    1049     rank int2 NOT NULL DEFAULT 0, 
     1080    id smallint, 
     1081    name text, 
     1082    rank smallint NOT NULL DEFAULT 0, 
    10501083    PRIMARY KEY (id) 
    10511084) TYPE=InnoDB; 
    10521085 
    10531086CREATE TABLE mtb_magazine_type ( 
    1054     id int2, 
    1055     name text, 
    1056     rank int2 NOT NULL DEFAULT 0, 
     1087    id smallint, 
     1088    name text, 
     1089    rank smallint NOT NULL DEFAULT 0, 
    10571090    PRIMARY KEY (id) 
    10581091) TYPE=InnoDB; 
    10591092 
    10601093CREATE TABLE mtb_mail_magazine_type ( 
    1061     id int2, 
    1062     name text, 
    1063     rank int2 NOT NULL DEFAULT 0, 
     1094    id smallint, 
     1095    name text, 
     1096    rank smallint NOT NULL DEFAULT 0, 
    10641097    PRIMARY KEY (id) 
    10651098) TYPE=InnoDB; 
    10661099 
    10671100CREATE TABLE mtb_recommend ( 
    1068     id int2, 
    1069     name text, 
    1070     rank int2 NOT NULL DEFAULT 0, 
     1101    id smallint, 
     1102    name text, 
     1103    rank smallint NOT NULL DEFAULT 0, 
    10711104    PRIMARY KEY (id) 
    10721105) TYPE=InnoDB; 
    10731106 
    10741107CREATE TABLE mtb_taxrule ( 
    1075     id int2, 
    1076     name text, 
    1077     rank int2 NOT NULL DEFAULT 0, 
     1108    id smallint, 
     1109    name text, 
     1110    rank smallint NOT NULL DEFAULT 0, 
    10781111    PRIMARY KEY (id) 
    10791112) TYPE=InnoDB; 
    10801113 
    10811114CREATE TABLE mtb_mail_template ( 
    1082     id int2, 
    1083     name text, 
    1084     rank int2 NOT NULL DEFAULT 0, 
     1115    id smallint, 
     1116    name text, 
     1117    rank smallint NOT NULL DEFAULT 0, 
    10851118    PRIMARY KEY (id) 
    10861119) TYPE=InnoDB; 
    10871120 
    10881121CREATE TABLE mtb_mail_tpl_path ( 
    1089     id int2, 
    1090     name text, 
    1091     rank int2 NOT NULL DEFAULT 0, 
     1122    id smallint, 
     1123    name text, 
     1124    rank smallint NOT NULL DEFAULT 0, 
    10921125    PRIMARY KEY (id) 
    10931126) TYPE=InnoDB; 
    10941127 
    10951128CREATE TABLE mtb_job ( 
    1096     id int2, 
    1097     name text, 
    1098     rank int2 NOT NULL DEFAULT 0, 
     1129    id smallint, 
     1130    name text, 
     1131    rank smallint NOT NULL DEFAULT 0, 
    10991132    PRIMARY KEY (id) 
    11001133) TYPE=InnoDB; 
    11011134 
    11021135CREATE TABLE mtb_reminder ( 
    1103     id int2, 
    1104     name text, 
    1105     rank int2 NOT NULL DEFAULT 0, 
     1136    id smallint, 
     1137    name text, 
     1138    rank smallint NOT NULL DEFAULT 0, 
    11061139    PRIMARY KEY (id) 
    11071140) TYPE=InnoDB; 
    11081141 
    11091142CREATE TABLE mtb_sex ( 
    1110     id int2, 
    1111     name text, 
    1112     rank int2 NOT NULL DEFAULT 0, 
     1143    id smallint, 
     1144    name text, 
     1145    rank smallint NOT NULL DEFAULT 0, 
    11131146    PRIMARY KEY (id) 
    11141147) TYPE=InnoDB; 
    11151148 
    11161149CREATE TABLE mtb_page_rows ( 
    1117     id int2, 
    1118     name text, 
    1119     rank int2 NOT NULL DEFAULT 0, 
     1150    id smallint, 
     1151    name text, 
     1152    rank smallint NOT NULL DEFAULT 0, 
    11201153    PRIMARY KEY (id) 
    11211154) TYPE=InnoDB; 
    11221155 
    11231156CREATE TABLE mtb_mail_type ( 
    1124     id int2, 
    1125     name text, 
    1126     rank int2 NOT NULL DEFAULT 0, 
     1157    id smallint, 
     1158    name text, 
     1159    rank smallint NOT NULL DEFAULT 0, 
    11271160    PRIMARY KEY (id) 
    11281161) TYPE=InnoDB; 
    11291162 
    11301163CREATE TABLE mtb_order_status ( 
    1131     id int2, 
    1132     name text, 
    1133     rank int2 NOT NULL DEFAULT 0, 
     1164    id smallint, 
     1165    name text, 
     1166    rank smallint NOT NULL DEFAULT 0, 
    11341167    PRIMARY KEY (id) 
    11351168) TYPE=InnoDB; 
    11361169 
    11371170CREATE TABLE mtb_product_status_color ( 
    1138     id int2, 
    1139     name text, 
    1140     rank int2 NOT NULL DEFAULT 0, 
     1171    id smallint, 
     1172    name text, 
     1173    rank smallint NOT NULL DEFAULT 0, 
    11411174    PRIMARY KEY (id) 
    11421175) TYPE=InnoDB; 
    11431176 
    11441177CREATE TABLE mtb_order_status_color ( 
    1145     id int2, 
    1146     name text, 
    1147     rank int2 NOT NULL DEFAULT 0, 
     1178    id smallint, 
     1179    name text, 
     1180    rank smallint NOT NULL DEFAULT 0, 
    11481181    PRIMARY KEY (id) 
    11491182) TYPE=InnoDB; 
    11501183 
    11511184CREATE TABLE mtb_wday ( 
    1152     id int2, 
    1153     name text, 
    1154     rank int2 NOT NULL DEFAULT 0, 
     1185    id smallint, 
     1186    name text, 
     1187    rank smallint NOT NULL DEFAULT 0, 
    11551188    PRIMARY KEY (id) 
    11561189) TYPE=InnoDB; 
    11571190 
    11581191CREATE TABLE mtb_delivery_date ( 
    1159     id int2, 
    1160     name text, 
    1161     rank int2 NOT NULL DEFAULT 0, 
     1192    id smallint, 
     1193    name text, 
     1194    rank smallint NOT NULL DEFAULT 0, 
    11621195    PRIMARY KEY (id) 
    11631196) TYPE=InnoDB; 
    11641197 
    11651198CREATE TABLE mtb_product_list_max ( 
    1166     id int2, 
    1167     name text, 
    1168     rank int2 NOT NULL DEFAULT 0, 
     1199    id smallint, 
     1200    name text, 
     1201    rank smallint NOT NULL DEFAULT 0, 
    11691202    PRIMARY KEY (id) 
    11701203) TYPE=InnoDB; 
    11711204 
    11721205CREATE TABLE mtb_convenience ( 
    1173     id int2, 
    1174     name text, 
    1175     rank int2 NOT NULL DEFAULT 0, 
     1206    id smallint, 
     1207    name text, 
     1208    rank smallint NOT NULL DEFAULT 0, 
    11761209    PRIMARY KEY (id) 
    11771210) TYPE=InnoDB; 
    11781211 
    11791212CREATE TABLE mtb_conveni_message ( 
    1180     id int2, 
    1181     name text, 
    1182     rank int2 NOT NULL DEFAULT 0, 
     1213    id smallint, 
     1214    name text, 
     1215    rank smallint NOT NULL DEFAULT 0, 
    11831216    PRIMARY KEY (id) 
    11841217) TYPE=InnoDB; 
    11851218 
    11861219CREATE TABLE mtb_db ( 
    1187     id int2, 
    1188     name text, 
    1189     rank int2 NOT NULL DEFAULT 0, 
     1220    id smallint, 
     1221    name text, 
     1222    rank smallint NOT NULL DEFAULT 0, 
    11901223    PRIMARY KEY (id) 
    11911224) TYPE=InnoDB; 
    11921225 
    11931226CREATE TABLE mtb_target ( 
    1194     id int2, 
    1195     name text, 
    1196     rank int2 NOT NULL DEFAULT 0, 
     1227    id smallint, 
     1228    name text, 
     1229    rank smallint NOT NULL DEFAULT 0, 
    11971230    PRIMARY KEY (id) 
    11981231) TYPE=InnoDB; 
    11991232 
    12001233CREATE TABLE mtb_review_deny_url ( 
    1201     id int2, 
    1202     name text, 
    1203     rank int2 NOT NULL DEFAULT 0, 
     1234    id smallint, 
     1235    name text, 
     1236    rank smallint NOT NULL DEFAULT 0, 
    12041237    PRIMARY KEY (id) 
    12051238) TYPE=InnoDB; 
    12061239 
    12071240CREATE TABLE mtb_track_back_status ( 
    1208     id int2, 
    1209     name text, 
    1210     rank int2 NOT NULL DEFAULT 0, 
     1241    id smallint, 
     1242    name text, 
     1243    rank smallint NOT NULL DEFAULT 0, 
    12111244    PRIMARY KEY (id) 
    12121245) TYPE=InnoDB; 
    12131246 
    12141247CREATE TABLE mtb_site_control_track_back ( 
    1215     id int2, 
    1216     name text, 
    1217     rank int2 NOT NULL DEFAULT 0, 
     1248    id smallint, 
     1249    name text, 
     1250    rank smallint NOT NULL DEFAULT 0, 
    12181251    PRIMARY KEY (id) 
    12191252) TYPE=InnoDB; 
    12201253 
    12211254CREATE TABLE mtb_site_control_affiliate ( 
    1222     id int2, 
    1223     name text, 
    1224     rank int2 NOT NULL DEFAULT 0, 
     1255    id smallint, 
     1256    name text, 
     1257    rank smallint NOT NULL DEFAULT 0, 
    12251258    PRIMARY KEY (id) 
    12261259) TYPE=InnoDB; 
    12271260 
    12281261CREATE TABLE mtb_mobile_domain ( 
    1229     id int2, 
    1230     name text, 
    1231     rank int2 NOT NULL DEFAULT 0, 
     1262    id smallint, 
     1263    name text, 
     1264    rank smallint NOT NULL DEFAULT 0, 
    12321265    PRIMARY KEY (id) 
    12331266) TYPE=InnoDB; 
    12341267 
    12351268CREATE TABLE mtb_ownersstore_err ( 
    1236     id int2, 
    1237     name text, 
    1238     rank int2 NOT NULL DEFAULT 0, 
     1269    id smallint, 
     1270    name text, 
     1271    rank smallint NOT NULL DEFAULT 0, 
    12391272    PRIMARY KEY (id) 
    12401273) TYPE=InnoDB; 
    12411274 
    12421275CREATE TABLE mtb_ownersstore_ips ( 
    1243     id int2, 
    1244     name text, 
    1245     rank int2 NOT NULL DEFAULT 0, 
     1276    id smallint, 
     1277    name text, 
     1278    rank smallint NOT NULL DEFAULT 0, 
    12461279    PRIMARY KEY (id) 
    12471280) TYPE=InnoDB; 
     
    12501283    id text, 
    12511284    name text, 
    1252     rank int2 NOT NULL DEFAULT 0, 
    1253     remarks text 
    1254 ) TYPE=InnoDB; 
     1285    rank smallint NOT NULL DEFAULT 0, 
     1286    remarks text, 
     1287    PRIMARY KEY (id(64)) 
     1288) TYPE=InnoDB; 
Note: See TracChangeset for help on using the changeset viewer.