Changeset 18331


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

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

Location:
branches/comu-ver2/html/install/sql
Files:
2 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; 
  • branches/comu-ver2/html/install/sql/create_table_pgsql.sql

    r18275 r18331  
    33    module_id int NOT NULL, 
    44    buckup_path text, 
    5     error_flg int2 default 0, 
     5    error_flg smallint DEFAULT 0, 
    66    error text, 
    77    ok text, 
     
    1919    kiyaku_title text NOT NULL, 
    2020    kiyaku_text text NOT NULL, 
    21     rank int4 NOT NULL DEFAULT 0, 
    22     creator_id int4 NOT NULL, 
     21    rank int NOT NULL DEFAULT 0, 
     22    creator_id int NOT NULL, 
    2323    create_date timestamp NOT NULL DEFAULT now(), 
    2424    update_date timestamp NOT NULL, 
    25     del_flg int2 NOT NULL DEFAULT 0, 
     25    del_flg smallint NOT NULL DEFAULT 0, 
    2626    PRIMARY KEY (kiyaku_id) 
    2727); 
     
    3030    holiday_id serial NOT NULL, 
    3131    title text NOT NULL, 
    32     month int2 NOT NULL, 
    33     day int2 NOT NULL, 
    34     rank int4 NOT NULL DEFAULT 0, 
    35     creator_id int4 NOT NULL, 
     32    month smallint NOT NULL, 
     33    day smallint NOT NULL, 
     34    rank int NOT NULL DEFAULT 0, 
     35    creator_id int NOT NULL, 
    3636    create_date timestamp NOT NULL DEFAULT now(), 
    3737    update_date timestamp NOT NULL, 
    38     del_flg int2 NOT NULL DEFAULT 0, 
     38    del_flg smallint NOT NULL DEFAULT 0, 
    3939    PRIMARY KEY (holiday_id) 
    4040); 
     
    6262    total numeric NOT NULL DEFAULT 0, 
    6363    total_average numeric NOT NULL DEFAULT 0, 
    64     start_age int2, 
    65     end_age int2, 
    66     member int2, 
     64    start_age smallint, 
     65    end_age smallint, 
     66    member smallint, 
    6767    order_date timestamp DEFAULT now(), 
    6868    create_date timestamp NOT NULL DEFAULT now() 
     
    7070 
    7171CREATE TABLE dtb_update ( 
    72     module_id int4 NOT NULL, 
     72    module_id int NOT NULL, 
    7373    module_name text NOT NULL, 
    7474    now_version text, 
     
    8080    uninstall_sql text, 
    8181    other_files text, 
    82     del_flg int2 NOT NULL DEFAULT 0, 
     82    del_flg smallint NOT NULL DEFAULT 0, 
    8383    create_date timestamp NOT NULL DEFAULT now(), 
    8484    update_date timestamp, 
     
    9292    zip01 text, 
    9393    zip02 text, 
    94     pref int2, 
     94    pref smallint, 
    9595    addr01 text, 
    9696    addr02 text, 
     
    106106    law_zip01 text, 
    107107    law_zip02 text, 
    108     law_pref int2, 
     108    law_pref smallint, 
    109109    law_addr01 text, 
    110110    law_addr02 text, 
     
    128128    law_term10 text, 
    129129    tax numeric NOT NULL DEFAULT 5, 
    130     tax_rule int2 NOT NULL DEFAULT 1, 
     130    tax_rule smallint NOT NULL DEFAULT 1, 
    131131    email01 text, 
    132132    email02 text, 
     
    154154    service_name text, 
    155155    confirm_url text, 
    156     rank int4, 
    157     status int2 NOT NULL DEFAULT 1, 
    158     del_flg int2 NOT NULL DEFAULT 0, 
    159     creator_id int4 NOT NULL, 
     156    rank int, 
     157    status smallint NOT NULL DEFAULT 1, 
     158    del_flg smallint NOT NULL DEFAULT 0, 
     159    creator_id int NOT NULL, 
    160160    create_date timestamp NOT NULL DEFAULT now(), 
    161161    update_date timestamp, 
     
    164164 
    165165CREATE TABLE dtb_delivtime ( 
    166     deliv_id int4 NOT NULL, 
    167     time_id int4 NOT NULL, 
     166    deliv_id int NOT NULL, 
     167    time_id int NOT NULL, 
    168168    deliv_time text NOT NULL, 
    169169    PRIMARY KEY (deliv_id, time_id) 
     
    171171 
    172172CREATE TABLE dtb_delivfee ( 
    173     deliv_id int4 NOT NULL, 
     173    deliv_id int NOT NULL, 
    174174    fee_id serial NOT NULL, 
    175175    fee text NOT NULL, 
    176     pref int2, 
     176    pref smallint, 
    177177    PRIMARY KEY (fee_id) 
    178178); 
     
    183183    charge numeric, 
    184184    rule numeric, 
    185     deliv_id int4 DEFAULT 0, 
    186     rank int4, 
     185    deliv_id int DEFAULT 0, 
     186    rank int, 
    187187    note text, 
    188     fix int2, 
    189     status int2 NOT NULL DEFAULT 1, 
    190     del_flg int2 NOT NULL DEFAULT 0, 
    191     creator_id int4 NOT NULL, 
     188    fix smallint, 
     189    status smallint NOT NULL DEFAULT 1, 
     190    del_flg smallint NOT NULL DEFAULT 0, 
     191    creator_id int NOT NULL, 
    192192    create_date timestamp NOT NULL DEFAULT now(), 
    193193    update_date timestamp, 
    194194    payment_image text, 
    195195    upper_rule numeric, 
    196     charge_flg int2 DEFAULT 1, 
     196    charge_flg smallint DEFAULT 1, 
    197197    rule_min numeric, 
    198198    upper_rule_max numeric, 
    199     module_id int4, 
     199    module_id int, 
    200200    module_path text, 
    201201    memo01 text, 
     
    213213 
    214214CREATE TABLE dtb_mailtemplate ( 
    215     template_id int4 NOT NULL, 
     215    template_id int NOT NULL, 
    216216    subject text, 
    217217    header text, 
    218218    footer text, 
    219     creator_id int4 NOT NULL, 
    220     del_flg int2 NOT NULL DEFAULT 0, 
     219    creator_id int NOT NULL, 
     220    del_flg smallint NOT NULL DEFAULT 0, 
    221221    create_date timestamp NOT NULL DEFAULT now(), 
    222222    update_date timestamp NOT NULL 
     
    227227    subject text, 
    228228    charge_image text, 
    229     mail_method int4, 
     229    mail_method int, 
    230230    header text, 
    231231    body text, 
    232232    main_title text, 
    233233    main_comment text, 
    234     main_product_id int4, 
     234    main_product_id int, 
    235235    sub_title text, 
    236236    sub_comment text, 
    237     sub_product_id01 int4, 
    238     sub_product_id02 int4, 
    239     sub_product_id03 int4, 
    240     sub_product_id04 int4, 
    241     sub_product_id05 int4, 
    242     sub_product_id06 int4, 
    243     sub_product_id07 int4, 
    244     sub_product_id08 int4, 
    245     sub_product_id09 int4, 
    246     sub_product_id10 int4, 
    247     sub_product_id11 int4, 
    248     sub_product_id12 int4, 
    249     del_flg int2 NOT NULL DEFAULT 0, 
    250     creator_id int4 NOT NULL, 
     237    sub_product_id01 int, 
     238    sub_product_id02 int, 
     239    sub_product_id03 int, 
     240    sub_product_id04 int, 
     241    sub_product_id05 int, 
     242    sub_product_id06 int, 
     243    sub_product_id07 int, 
     244    sub_product_id08 int, 
     245    sub_product_id09 int, 
     246    sub_product_id10 int, 
     247    sub_product_id11 int, 
     248    sub_product_id12 int, 
     249    del_flg smallint NOT NULL DEFAULT 0, 
     250    creator_id int NOT NULL, 
    251251    create_date timestamp NOT NULL DEFAULT now(), 
    252252    update_date timestamp, 
     
    256256CREATE TABLE dtb_send_history ( 
    257257    send_id serial NOT NULL, 
    258     mail_method int2, 
     258    mail_method smallint, 
    259259    subject text, 
    260260    body text, 
    261     send_count int4, 
    262     complete_count int4 NOT NULL DEFAULT 0, 
     261    send_count int, 
     262    complete_count int NOT NULL DEFAULT 0, 
    263263    start_date timestamp, 
    264264    end_date timestamp, 
    265265    search_data text, 
    266     del_flg int2 NOT NULL DEFAULT 0, 
    267     creator_id int4 NOT NULL, 
     266    del_flg smallint NOT NULL DEFAULT 0, 
     267    creator_id int NOT NULL, 
    268268    create_date timestamp NOT NULL DEFAULT now(), 
    269269    update_date timestamp NOT NULL DEFAULT now(), 
     
    272272 
    273273CREATE TABLE dtb_send_customer ( 
    274     customer_id int4, 
     274    customer_id int, 
    275275    send_id serial NOT NULL, 
    276276    email text, 
    277277    name text, 
    278     send_flag int2 
     278    send_flag smallint 
    279279); 
    280280 
     
    284284    deliv_fee numeric, 
    285285    sale_limit numeric, 
    286     category_id int4, 
    287     maker_id int4, 
    288     rank int4, 
    289     status int2 NOT NULL DEFAULT 2, 
     286    category_id int, 
     287    maker_id int, 
     288    rank int, 
     289    status smallint NOT NULL DEFAULT 2, 
    290290    product_flag text, 
    291291    point_rate numeric, 
     
    332332    sub_image6 text, 
    333333    sub_large_image6 text, 
    334     del_flg int2 NOT NULL DEFAULT 0, 
    335     creator_id int4 NOT NULL, 
    336     create_date timestamp NOT NULL DEFAULT now(), 
    337     update_date timestamp, 
    338     deliv_date_id int4, 
     334    del_flg smallint NOT NULL DEFAULT 0, 
     335    creator_id int NOT NULL, 
     336    create_date timestamp NOT NULL DEFAULT now(), 
     337    update_date timestamp, 
     338    deliv_date_id int, 
    339339    PRIMARY KEY (product_id) 
    340340); 
     
    342342CREATE TABLE dtb_products_class ( 
    343343    product_class_id serial NOT NULL, 
    344     product_id int4 NOT NULL, 
    345     classcategory_id1 int4 NOT NULL DEFAULT 0, 
    346     classcategory_id2 int4 NOT NULL DEFAULT 0, 
     344    product_id int NOT NULL, 
     345    classcategory_id1 int NOT NULL DEFAULT 0, 
     346    classcategory_id2 int NOT NULL DEFAULT 0, 
    347347    product_code text, 
    348348    stock numeric, 
    349     stock_unlimited int2 NOT NULL DEFAULT 0, 
     349    stock_unlimited smallint NOT NULL DEFAULT 0, 
    350350    sale_limit numeric, 
    351351    price01 numeric, 
    352352    price02 numeric, 
    353     status int2, 
    354     creator_id int4 NOT NULL, 
     353    status smallint, 
     354    creator_id int NOT NULL, 
    355355    create_date timestamp NOT NULL DEFAULT now(), 
    356356    update_date timestamp, 
     
    361361    class_id serial NOT NULL, 
    362362    name text, 
    363     status int2, 
    364     rank int4, 
    365     creator_id int4 NOT NULL, 
    366     create_date timestamp NOT NULL DEFAULT now(), 
    367     update_date timestamp, 
    368     del_flg int2 NOT NULL DEFAULT 0, 
    369     product_id int4, 
     363    status smallint, 
     364    rank int, 
     365    creator_id int NOT NULL, 
     366    create_date timestamp NOT NULL DEFAULT now(), 
     367    update_date timestamp, 
     368    del_flg smallint NOT NULL DEFAULT 0, 
     369    product_id int, 
    370370    PRIMARY KEY (class_id) 
    371371); 
     
    374374    classcategory_id serial NOT NULL, 
    375375    name text, 
    376     class_id int4 NOT NULL, 
    377     status int2, 
    378     rank int4, 
    379     creator_id int4 NOT NULL, 
    380     create_date timestamp NOT NULL DEFAULT now(), 
    381     update_date timestamp, 
    382     del_flg int2 NOT NULL DEFAULT 0, 
     376    class_id int NOT NULL, 
     377    status smallint, 
     378    rank int, 
     379    creator_id int NOT NULL, 
     380    create_date timestamp NOT NULL DEFAULT now(), 
     381    update_date timestamp, 
     382    del_flg smallint NOT NULL DEFAULT 0, 
    383383    PRIMARY KEY (classcategory_id) 
    384384); 
     
    387387    category_id serial NOT NULL, 
    388388    category_name text, 
    389     parent_category_id int4 NOT NULL DEFAULT 0, 
    390     level int4 NOT NULL, 
    391     rank int4, 
    392     creator_id int4 NOT NULL, 
    393     create_date timestamp NOT NULL DEFAULT now(), 
    394     update_date timestamp, 
    395     del_flg int2 NOT NULL DEFAULT 0, 
     389    parent_category_id int NOT NULL DEFAULT 0, 
     390    level int NOT NULL, 
     391    rank int, 
     392    creator_id int NOT NULL, 
     393    create_date timestamp NOT NULL DEFAULT now(), 
     394    update_date timestamp, 
     395    del_flg smallint NOT NULL DEFAULT 0, 
    396396    PRIMARY KEY (category_id) 
    397397); 
    398398 
    399399CREATE TABLE dtb_product_categories ( 
    400     product_id int4 NOT NULL, 
    401     category_id int4 NOT NULL, 
    402     rank int4 NOT NULL, 
     400    product_id int NOT NULL, 
     401    category_id int NOT NULL, 
     402    rank int NOT NULL, 
    403403    PRIMARY KEY(product_id, category_id) 
    404404); 
     
    418418    order_date timestamp NOT NULL DEFAULT now(), 
    419419    create_date timestamp NOT NULL DEFAULT now(), 
    420     year int2 NOT NULL, 
    421     month int2 NOT NULL, 
    422     day int2 NOT NULL, 
    423     wday int2 NOT NULL, 
     420    year smallint NOT NULL, 
     421    month smallint NOT NULL, 
     422    day smallint NOT NULL, 
     423    wday smallint NOT NULL, 
    424424    key_day text NOT NULL, 
    425425    key_month text NOT NULL, 
     
    440440    total numeric NOT NULL DEFAULT 0, 
    441441    total_average numeric NOT NULL DEFAULT 0, 
    442     hour int2 NOT NULL DEFAULT 0, 
     442    hour smallint NOT NULL DEFAULT 0, 
    443443    order_date timestamp DEFAULT now(), 
    444444    create_date timestamp NOT NULL DEFAULT now() 
     
    446446 
    447447CREATE TABLE dtb_recommend_products ( 
    448     product_id int4 NOT NULL, 
    449     recommend_product_id int4 NOT NULL, 
    450     rank int4 NOT NULL, 
     448    product_id int NOT NULL, 
     449    recommend_product_id int NOT NULL, 
     450    rank int NOT NULL, 
    451451    comment text, 
    452     status int2 NOT NULL DEFAULT 0, 
    453     creator_id int4 NOT NULL, 
     452    status smallint NOT NULL DEFAULT 0, 
     453    creator_id int NOT NULL, 
    454454    create_date timestamp NOT NULL DEFAULT now(), 
    455455    update_date timestamp NOT NULL DEFAULT now() 
     
    458458CREATE TABLE dtb_review ( 
    459459    review_id serial NOT NULL, 
    460     product_id int4 NOT NULL, 
     460    product_id int NOT NULL, 
    461461    reviewer_name text NOT NULL, 
    462462    reviewer_url text, 
    463     sex int2, 
    464     customer_id int4, 
    465     recommend_level int2 NOT NULL, 
     463    sex smallint, 
     464    customer_id int, 
     465    recommend_level smallint NOT NULL, 
    466466    title text NOT NULL, 
    467467    comment text NOT NULL, 
    468     status int2 DEFAULT 2, 
    469     creator_id int4 NOT NULL, 
    470     create_date timestamp NOT NULL DEFAULT now(), 
    471     update_date timestamp, 
    472     del_flg int2 NOT NULL DEFAULT 0, 
     468    status smallint DEFAULT 2, 
     469    creator_id int NOT NULL, 
     470    create_date timestamp NOT NULL DEFAULT now(), 
     471    update_date timestamp, 
     472    del_flg smallint NOT NULL DEFAULT 0, 
    473473    PRIMARY KEY (review_id) 
    474474); 
    475475 
    476476CREATE TABLE dtb_customer_reading ( 
    477     reading_product_id int4 NOT NULL, 
    478     customer_id int4 NOT NULL, 
     477    reading_product_id int NOT NULL, 
     478    customer_id int NOT NULL, 
    479479    create_date timestamp NOT NULL, 
    480480    update_date timestamp NOT NULL DEFAULT NOW() 
     
    482482 
    483483CREATE TABLE dtb_customer_favorite_products ( 
    484     customer_id int4 NOT NULL, 
    485     product_id int4 NOT NULL, 
     484    customer_id int NOT NULL, 
     485    product_id int NOT NULL, 
    486486    create_date timestamp NOT NULL DEFAULT now(), 
    487487    update_date timestamp NOT NULL DEFAULT now(), 
     
    490490 
    491491CREATE TABLE dtb_category_count ( 
    492     category_id int4 NOT NULL, 
    493     product_count int4 NOT NULL, 
     492    category_id int NOT NULL, 
     493    product_count int NOT NULL, 
    494494    create_date timestamp NOT NULL DEFAULT Now() 
    495495); 
    496496 
    497497CREATE TABLE dtb_category_total_count ( 
    498     category_id int4 NOT NULL, 
    499     product_count int4, 
     498    category_id int NOT NULL, 
     499    product_count int, 
    500500    create_date timestamp NOT NULL DEFAULT Now() 
    501501); 
     
    504504    news_id serial NOT NULL, 
    505505    news_date timestamp, 
    506     rank int4, 
     506    rank int, 
    507507    news_title text NOT NULL, 
    508508    news_comment text, 
    509509    news_url text, 
    510     news_select int2 NOT NULL DEFAULT 0, 
     510    news_select smallint NOT NULL DEFAULT 0, 
    511511    link_method text, 
    512     creator_id int4 NOT NULL, 
    513     create_date timestamp NOT NULL DEFAULT now(), 
    514     update_date timestamp, 
    515     del_flg int2 NOT NULL DEFAULT 0, 
     512    creator_id int NOT NULL, 
     513    create_date timestamp NOT NULL DEFAULT now(), 
     514    update_date timestamp, 
     515    del_flg smallint NOT NULL DEFAULT 0, 
    516516    PRIMARY KEY (news_id) 
    517517); 
     
    519519CREATE TABLE dtb_best_products ( 
    520520    best_id serial NOT NULL, 
    521     category_id int4 NOT NULL, 
    522     rank int4 NOT NULL DEFAULT 0, 
    523     product_id int4 NOT NULL, 
     521    category_id int NOT NULL, 
     522    rank int NOT NULL DEFAULT 0, 
     523    product_id int NOT NULL, 
    524524    title text, 
    525525    comment text, 
    526     creator_id int4 NOT NULL, 
    527     create_date timestamp NOT NULL DEFAULT now(), 
    528     update_date timestamp, 
    529     del_flg int2 NOT NULL DEFAULT 0, 
     526    creator_id int NOT NULL, 
     527    create_date timestamp NOT NULL DEFAULT now(), 
     528    update_date timestamp, 
     529    del_flg smallint NOT NULL DEFAULT 0, 
    530530    PRIMARY KEY (best_id) 
    531531); 
    532532 
    533533CREATE TABLE dtb_mail_history ( 
    534     send_id serial  NOT NULL, 
    535     order_id int4 NOT NULL, 
     534    send_id serial NOT NULL, 
     535    order_id int NOT NULL, 
    536536    send_date timestamp, 
    537     template_id int4, 
    538     creator_id int4 NOT NULL, 
     537    template_id int, 
     538    creator_id int NOT NULL, 
    539539    subject text, 
    540540    mail_body text, 
     
    543543 
    544544CREATE TABLE dtb_customer ( 
    545     customer_id serial  NOT NULL, 
     545    customer_id serial NOT NULL, 
    546546    name01 text NOT NULL, 
    547547    name02 text NOT NULL, 
     
    550550    zip01 text, 
    551551    zip02 text, 
    552     pref int2, 
     552    pref smallint, 
    553553    addr01 text, 
    554554    addr02 text, 
     
    561561    fax02 text, 
    562562    fax03 text, 
    563     sex int2, 
    564     job int2, 
     563    sex smallint, 
     564    job smallint, 
    565565    birth timestamp, 
    566566    password text, 
    567     reminder int2, 
     567    reminder smallint, 
    568568    reminder_answer text, 
    569569    secret_key text NOT NULL UNIQUE, 
     
    574574    point numeric DEFAULT 0, 
    575575    note text, 
    576     status int2 NOT NULL DEFAULT 1, 
     576    status smallint NOT NULL DEFAULT 1, 
    577577    create_date timestamp NOT NULL DEFAULT now(), 
    578578    update_date timestamp DEFAULT now(), 
    579     del_flg int2 NOT NULL DEFAULT 0, 
     579    del_flg smallint NOT NULL DEFAULT 0, 
    580580    cell01 text, 
    581581    cell02 text, 
    582582    cell03 text, 
    583583    mobile_phone_id text, 
    584     mailmaga_flg int2, 
     584    mailmaga_flg smallint, 
    585585    PRIMARY KEY (customer_id) 
    586586); 
     
    590590CREATE TABLE dtb_customer_mail_temp ( 
    591591    email text NOT NULL UNIQUE, 
    592     mail_flag int2, 
     592    mail_flag smallint, 
    593593    temp_id text NOT NULL, 
    594     end_flag int2, 
     594    end_flag smallint, 
    595595    update_date timestamp NOT NULL DEFAULT Now(), 
    596596    create_data timestamp NOT NULL DEFAULT Now(), 
     
    601601    order_id serial NOT NULL, 
    602602    order_temp_id text, 
    603     customer_id int4 NOT NULL, 
     603    customer_id int NOT NULL, 
    604604    message text, 
    605605    order_name01 text, 
     
    619619    order_addr01 text, 
    620620    order_addr02 text, 
    621     order_sex int2, 
     621    order_sex smallint, 
    622622    order_birth timestamp, 
    623     order_job int4, 
     623    order_job int, 
    624624    deliv_name01 text, 
    625625    deliv_name02 text, 
     
    647647    total numeric, 
    648648    payment_total numeric, 
    649     payment_id int4, 
     649    payment_id int, 
    650650    payment_method text, 
    651     deliv_id int4, 
    652     deliv_time_id int4, 
     651    deliv_id int, 
     652    deliv_time_id int, 
    653653    deliv_time text, 
    654654    deliv_no text, 
    655655    note text, 
    656     status int2, 
     656    status smallint, 
    657657    create_date timestamp NOT NULL DEFAULT now(), 
    658658    loan_result text, 
     
    661661    update_date timestamp, 
    662662    commit_date timestamp, 
    663     del_flg int2 NOT NULL DEFAULT 0, 
     663    del_flg smallint NOT NULL DEFAULT 0, 
    664664    deliv_date text, 
    665665    conveni_data text, 
     
    677677    memo09 text, 
    678678    memo10 text, 
    679     campaign_id int4, 
     679    campaign_id int, 
    680680    PRIMARY KEY (order_id) 
    681681); 
     
    683683CREATE TABLE dtb_order_temp ( 
    684684    order_temp_id text NOT NULL, 
    685     customer_id int4 NOT NULL, 
     685    customer_id int NOT NULL, 
    686686    message text, 
    687687    order_name01 text, 
     
    701701    order_addr01 text, 
    702702    order_addr02 text, 
    703     order_sex int2, 
     703    order_sex smallint, 
    704704    order_birth timestamp, 
    705     order_job int4, 
     705    order_job int, 
    706706    deliv_name01 text, 
    707707    deliv_name02 text, 
     
    729729    total numeric, 
    730730    payment_total numeric, 
    731     payment_id int4, 
     731    payment_id int, 
    732732    payment_method text, 
    733     deliv_id int4, 
    734     deliv_time_id int4, 
     733    deliv_id int, 
     734    deliv_time_id int, 
    735735    deliv_time text, 
    736736    deliv_no text, 
    737737    note text, 
    738     mail_flag int2, 
    739     status int2, 
    740     deliv_check int2, 
    741     point_check int2, 
     738    mail_flag smallint, 
     739    status smallint, 
     740    deliv_check smallint, 
     741    point_check smallint, 
    742742    loan_result text, 
    743743    credit_result text, 
     
    745745    create_date timestamp NOT NULL DEFAULT now(), 
    746746    update_date timestamp, 
    747     del_flg int2 NOT NULL DEFAULT 0, 
     747    del_flg smallint NOT NULL DEFAULT 0, 
    748748    deliv_date text, 
    749749    conveni_data text, 
     
    751751    cell02 text, 
    752752    cell03 text, 
    753     order_id int4, 
     753    order_id int, 
    754754    memo01 text, 
    755755    memo02 text, 
     
    767767CREATE TABLE dtb_other_deliv ( 
    768768    other_deliv_id serial NOT NULL, 
    769     customer_id int4 NOT NULL, 
     769    customer_id int NOT NULL, 
    770770    name01 text, 
    771771    name02 text, 
     
    784784 
    785785CREATE TABLE dtb_order_detail ( 
    786     order_id int4 NOT NULL, 
    787     product_id int4 NOT NULL, 
    788     classcategory_id1 int4 NOT NULL, 
    789     classcategory_id2 int4 NOT NULL, 
     786    order_id int NOT NULL, 
     787    product_id int NOT NULL, 
     788    classcategory_id1 int NOT NULL, 
     789    classcategory_id2 int NOT NULL, 
    790790    product_name text NOT NULL, 
    791791    product_code text, 
     
    798798 
    799799CREATE TABLE mtb_pref ( 
    800     pref_id int2 NOT NULL, 
     800    pref_id smallint NOT NULL, 
    801801    pref_name text, 
    802     rank int2 NOT NULL DEFAULT 0, 
     802    rank smallint NOT NULL DEFAULT 0, 
    803803    PRIMARY KEY (pref_id) 
    804804); 
     
    810810    login_id text NOT NULL, 
    811811    password text NOT NULL, 
    812     authority int2 NOT NULL, 
    813     rank int4 NOT NULL DEFAULT 0, 
    814     work int2 NOT NULL DEFAULT 1, 
    815     del_flg int2 NOT NULL DEFAULT 0, 
    816     creator_id int4 NOT NULL, 
     812    authority smallint NOT NULL, 
     813    rank int NOT NULL DEFAULT 0, 
     814    work smallint NOT NULL DEFAULT 1, 
     815    del_flg smallint NOT NULL DEFAULT 0, 
     816    creator_id int NOT NULL, 
    817817    update_date timestamp, 
    818818    create_date timestamp NOT NULL DEFAULT now(), 
     
    826826    question text, 
    827827    create_date timestamp NOT NULL DEFAULT now(), 
    828     del_flg int2 NOT NULL DEFAULT 0, 
     828    del_flg smallint NOT NULL DEFAULT 0, 
    829829    PRIMARY KEY (question_id) 
    830830); 
     
    832832CREATE TABLE dtb_question_result ( 
    833833    result_id serial NOT NULL, 
    834     question_id int4 NOT NULL, 
     834    question_id int NOT NULL, 
    835835    question_date timestamp, 
    836836    question_name text, 
     
    841841    zip01 text, 
    842842    zip02 text, 
    843     pref int2, 
     843    pref smallint, 
    844844    addr01 text, 
    845845    addr02 text, 
     
    855855    question06 text, 
    856856    create_date timestamp NOT NULL DEFAULT now(), 
    857     del_flg int2 NOT NULL DEFAULT 0, 
     857    del_flg smallint NOT NULL DEFAULT 0, 
    858858    PRIMARY KEY (result_id) 
    859859); 
    860860 
    861861CREATE TABLE dtb_bat_relate_products ( 
    862     product_id int4, 
    863     relate_product_id int4, 
    864     customer_id int4, 
     862    product_id int, 
     863    relate_product_id int, 
     864    customer_id int, 
    865865    create_date timestamp DEFAULT now() 
    866866); 
     
    870870    campaign_name text, 
    871871    campaign_point_rate numeric NOT NULL, 
    872     campaign_point_type int2, 
     872    campaign_point_type smallint, 
    873873    start_date timestamp NOT NULL, 
    874874    end_date timestamp NOT NULL, 
    875875    directory_name text NOT NULL, 
    876     limit_count int4 NOT NULL DEFAULT 0, 
    877     total_count int4 NOT NULL DEFAULT 0, 
    878     orverlapping_flg int2 NOT NULL DEFAULT 0, 
    879     cart_flg int2 NOT NULL DEFAULT 0, 
    880     deliv_free_flg int2 NOT NULL DEFAULT 0, 
     876    limit_count int NOT NULL DEFAULT 0, 
     877    total_count int NOT NULL DEFAULT 0, 
     878    orverlapping_flg smallint NOT NULL DEFAULT 0, 
     879    cart_flg smallint NOT NULL DEFAULT 0, 
     880    deliv_free_flg smallint NOT NULL DEFAULT 0, 
    881881    search_condition text, 
    882     del_flg int2 NOT NULL DEFAULT 0, 
     882    del_flg smallint NOT NULL DEFAULT 0, 
    883883    create_date timestamp NOT NULL, 
    884884    update_date timestamp NOT NULL DEFAULT now(), 
     
    887887 
    888888CREATE TABLE dtb_campaign_detail ( 
    889     campaign_id int4 NOT NULL, 
    890     product_id int4 NOT NULL, 
     889    campaign_id int NOT NULL, 
     890    product_id int NOT NULL, 
    891891    campaign_point_rate numeric NOT NULL 
    892892); 
     
    899899    tpl_dir text, 
    900900    filename text, 
    901     header_chk int2 DEFAULT 1, 
    902     footer_chk int2 DEFAULT 1, 
    903     edit_flg int2 DEFAULT 1, 
     901    header_chk smallint DEFAULT 1, 
     902    footer_chk smallint DEFAULT 1, 
     903    edit_flg smallint DEFAULT 1, 
    904904    author text, 
    905905    description text, 
     
    919919    update_date timestamp NOT NULL DEFAULT now(), 
    920920    php_path text, 
    921     del_flg int2 NOT NULL DEFAULT 0, 
     921    del_flg smallint NOT NULL DEFAULT 0, 
    922922    PRIMARY KEY (bloc_id) 
    923923); 
    924924 
    925925CREATE TABLE dtb_blocposition ( 
    926     page_id int4 NOT NULL, 
    927     target_id int4, 
    928     bloc_id int4, 
    929     bloc_row int4, 
     926    page_id int NOT NULL, 
     927    target_id int, 
     928    bloc_id int, 
     929    bloc_row int, 
    930930    filename text, 
    931     anywhere int2 DEFAULT 0 NOT NULL 
     931    anywhere smallint DEFAULT 0 NOT NULL 
    932932); 
    933933 
    934934CREATE TABLE dtb_csv ( 
    935935    no serial, 
    936     csv_id int4 NOT NULL, 
     936    csv_id int NOT NULL, 
    937937    col text, 
    938938    disp_name text, 
    939     rank int4, 
    940     status int2 NOT NULL DEFAULT 1, 
     939    rank int, 
     940    status smallint NOT NULL DEFAULT 1, 
    941941    create_date timestamp NOT NULL DEFAULT now(), 
    942942    update_date timestamp NOT NULL DEFAULT now(), 
     
    965965    note text, 
    966966    secret_key text NOT NULL UNIQUE, 
    967     status int2 NOT NULL, 
    968     del_flg int2 DEFAULT 0, 
     967    status smallint NOT NULL, 
     968    del_flg smallint DEFAULT 0, 
    969969    create_date timestamp NOT NULL, 
    970970    update_date timestamp NOT NULL DEFAULT now(), 
     
    973973 
    974974create table dtb_templates ( 
    975     template_code        text        NOT NULL, 
    976     template_name        text            , 
    977     create_date        timestamp        NOT NULL    default now(), 
    978     update_date        timestamp        NOT NULL    default now(), 
     975    template_code text NOT NULL, 
     976    template_name text, 
     977    create_date timestamp NOT NULL DEFAULT now(), 
     978    update_date timestamp NOT NULL DEFAULT now(), 
    979979    PRIMARY KEY (template_code) 
    980980); 
    981981 
    982982create table dtb_table_comment ( 
    983     id    serial, 
    984     table_name    text, 
    985     column_name    text, 
    986     description    text, 
     983    id serial, 
     984    table_name text, 
     985    column_name text, 
     986    description text, 
    987987    PRIMARY KEY (id) 
    988988); 
     
    991991    maker_id serial NOT NULL, 
    992992    name text NOT NULL, 
    993     rank int4 NOT NULL DEFAULT 0, 
    994     creator_id int4 NOT NULL, 
     993    rank int NOT NULL DEFAULT 0, 
     994    creator_id int NOT NULL, 
    995995    create_date timestamp NOT NULL DEFAULT now(), 
    996996    update_date timestamp NOT NULL, 
    997     del_flg int2 NOT NULL DEFAULT 0, 
     997    del_flg smallint NOT NULL DEFAULT 0, 
    998998    PRIMARY KEY (maker_id) 
    999999); 
    10001000 
    10011001CREATE TABLE dtb_maker_count ( 
    1002     maker_id int4 NOT NULL, 
    1003     product_count int4 NOT NULL, 
     1002    maker_id int NOT NULL, 
     1003    product_count int NOT NULL, 
    10041004    create_date timestamp NOT NULL DEFAULT Now() 
    10051005); 
     
    10081008    id text, 
    10091009    name text, 
    1010     rank int2 NOT NULL DEFAULT 0, 
     1010    rank smallint NOT NULL DEFAULT 0, 
    10111011    PRIMARY KEY (id) 
    10121012); 
    10131013 
    10141014CREATE TABLE mtb_disable_logout ( 
    1015     id int2, 
    1016     name text, 
    1017     rank int2 NOT NULL DEFAULT 0, 
     1015    id smallint, 
     1016    name text, 
     1017    rank smallint NOT NULL DEFAULT 0, 
    10181018    PRIMARY KEY (id) 
    10191019); 
    10201020 
    10211021CREATE TABLE mtb_authority ( 
    1022     id int2, 
    1023     name text, 
    1024     rank int2 NOT NULL DEFAULT 0, 
     1022    id smallint, 
     1023    name text, 
     1024    rank smallint NOT NULL DEFAULT 0, 
    10251025    PRIMARY KEY (id) 
    10261026); 
    10271027 
    10281028CREATE TABLE mtb_work ( 
    1029     id int2, 
    1030     name text, 
    1031     rank int2 NOT NULL DEFAULT 0, 
     1029    id smallint, 
     1030    name text, 
     1031    rank smallint NOT NULL DEFAULT 0, 
    10321032    PRIMARY KEY (id) 
    10331033); 
    10341034 
    10351035CREATE TABLE mtb_disp ( 
    1036     id int2, 
    1037     name text, 
    1038     rank int2 NOT NULL DEFAULT 0, 
     1036    id smallint, 
     1037    name text, 
     1038    rank smallint NOT NULL DEFAULT 0, 
    10391039    PRIMARY KEY (id) 
    10401040); 
    10411041 
    10421042CREATE TABLE mtb_class ( 
    1043     id int2, 
    1044     name text, 
    1045     rank int2 NOT NULL DEFAULT 0, 
     1043    id smallint, 
     1044    name text, 
     1045    rank smallint NOT NULL DEFAULT 0, 
    10461046    PRIMARY KEY (id) 
    10471047); 
    10481048 
    10491049CREATE TABLE mtb_srank ( 
    1050     id int2, 
    1051     name text, 
    1052     rank int2 NOT NULL DEFAULT 0, 
     1050    id smallint, 
     1051    name text, 
     1052    rank smallint NOT NULL DEFAULT 0, 
    10531053    PRIMARY KEY (id) 
    10541054); 
    10551055 
    10561056CREATE TABLE mtb_status ( 
    1057     id int2, 
    1058     name text, 
    1059     rank int2 NOT NULL DEFAULT 0, 
     1057    id smallint, 
     1058    name text, 
     1059    rank smallint NOT NULL DEFAULT 0, 
    10601060    PRIMARY KEY (id) 
    10611061); 
    10621062 
    10631063CREATE TABLE mtb_status_image ( 
    1064     id int2, 
    1065     name text, 
    1066     rank int2 NOT NULL DEFAULT 0, 
     1064    id smallint, 
     1065    name text, 
     1066    rank smallint NOT NULL DEFAULT 0, 
    10671067    PRIMARY KEY (id) 
    10681068); 
    10691069 
    10701070CREATE TABLE mtb_allowed_tag ( 
    1071     id int2, 
    1072     name text, 
    1073     rank int2 NOT NULL DEFAULT 0, 
     1071    id smallint, 
     1072    name text, 
     1073    rank smallint NOT NULL DEFAULT 0, 
    10741074    PRIMARY KEY (id) 
    10751075); 
    10761076 
    10771077CREATE TABLE mtb_page_max ( 
    1078     id int2, 
    1079     name text, 
    1080     rank int2 NOT NULL DEFAULT 0, 
     1078    id smallint, 
     1079    name text, 
     1080    rank smallint NOT NULL DEFAULT 0, 
    10811081    PRIMARY KEY (id) 
    10821082); 
    10831083 
    10841084CREATE TABLE mtb_magazine_type ( 
    1085     id int2, 
    1086     name text, 
    1087     rank int2 NOT NULL DEFAULT 0, 
     1085    id smallint, 
     1086    name text, 
     1087    rank smallint NOT NULL DEFAULT 0, 
    10881088    PRIMARY KEY (id) 
    10891089); 
    10901090 
    10911091CREATE TABLE mtb_mail_magazine_type ( 
    1092     id int2, 
    1093     name text, 
    1094     rank int2 NOT NULL DEFAULT 0, 
     1092    id smallint, 
     1093    name text, 
     1094    rank smallint NOT NULL DEFAULT 0, 
    10951095    PRIMARY KEY (id) 
    10961096); 
    10971097 
    10981098CREATE TABLE mtb_recommend ( 
    1099     id int2, 
    1100     name text, 
    1101     rank int2 NOT NULL DEFAULT 0, 
     1099    id smallint, 
     1100    name text, 
     1101    rank smallint NOT NULL DEFAULT 0, 
    11021102    PRIMARY KEY (id) 
    11031103); 
    11041104 
    11051105CREATE TABLE mtb_taxrule ( 
    1106     id int2, 
    1107     name text, 
    1108     rank int2 NOT NULL DEFAULT 0, 
     1106    id smallint, 
     1107    name text, 
     1108    rank smallint NOT NULL DEFAULT 0, 
    11091109    PRIMARY KEY (id) 
    11101110); 
    11111111 
    11121112CREATE TABLE mtb_mail_template ( 
    1113     id int2, 
    1114     name text, 
    1115     rank int2 NOT NULL DEFAULT 0, 
     1113    id smallint, 
     1114    name text, 
     1115    rank smallint NOT NULL DEFAULT 0, 
    11161116    PRIMARY KEY (id) 
    11171117); 
    11181118 
    11191119CREATE TABLE mtb_mail_tpl_path ( 
    1120     id int2, 
    1121     name text, 
    1122     rank int2 NOT NULL DEFAULT 0, 
     1120    id smallint, 
     1121    name text, 
     1122    rank smallint NOT NULL DEFAULT 0, 
    11231123    PRIMARY KEY (id) 
    11241124); 
    11251125 
    11261126CREATE TABLE mtb_job ( 
    1127     id int2, 
    1128     name text, 
    1129     rank int2 NOT NULL DEFAULT 0, 
     1127    id smallint, 
     1128    name text, 
     1129    rank smallint NOT NULL DEFAULT 0, 
    11301130    PRIMARY KEY (id) 
    11311131); 
    11321132 
    11331133CREATE TABLE mtb_reminder ( 
    1134     id int2, 
    1135     name text, 
    1136     rank int2 NOT NULL DEFAULT 0, 
     1134    id smallint, 
     1135    name text, 
     1136    rank smallint NOT NULL DEFAULT 0, 
    11371137    PRIMARY KEY (id) 
    11381138); 
    11391139 
    11401140CREATE TABLE mtb_sex ( 
    1141     id int2, 
    1142     name text, 
    1143     rank int2 NOT NULL DEFAULT 0, 
     1141    id smallint, 
     1142    name text, 
     1143    rank smallint NOT NULL DEFAULT 0, 
    11441144    PRIMARY KEY (id) 
    11451145); 
    11461146 
    11471147CREATE TABLE mtb_page_rows ( 
    1148     id int2, 
    1149     name text, 
    1150     rank int2 NOT NULL DEFAULT 0, 
     1148    id smallint, 
     1149    name text, 
     1150    rank smallint NOT NULL DEFAULT 0, 
    11511151    PRIMARY KEY (id) 
    11521152); 
    11531153 
    11541154CREATE TABLE mtb_mail_type ( 
    1155     id int2, 
    1156     name text, 
    1157     rank int2 NOT NULL DEFAULT 0, 
     1155    id smallint, 
     1156    name text, 
     1157    rank smallint NOT NULL DEFAULT 0, 
    11581158    PRIMARY KEY (id) 
    11591159); 
    11601160 
    11611161CREATE TABLE mtb_order_status ( 
    1162     id int2, 
    1163     name text, 
    1164     rank int2 NOT NULL DEFAULT 0, 
     1162    id smallint, 
     1163    name text, 
     1164    rank smallint NOT NULL DEFAULT 0, 
    11651165    PRIMARY KEY (id) 
    11661166); 
    11671167 
    11681168CREATE TABLE mtb_product_status_color ( 
    1169     id int2, 
    1170     name text, 
    1171     rank int2 NOT NULL DEFAULT 0, 
     1169    id smallint, 
     1170    name text, 
     1171    rank smallint NOT NULL DEFAULT 0, 
    11721172    PRIMARY KEY (id) 
    11731173); 
    11741174 
    11751175CREATE TABLE mtb_order_status_color ( 
    1176     id int2, 
    1177     name text, 
    1178     rank int2 NOT NULL DEFAULT 0, 
     1176    id smallint, 
     1177    name text, 
     1178    rank smallint NOT NULL DEFAULT 0, 
    11791179    PRIMARY KEY (id) 
    11801180); 
    11811181 
    11821182CREATE TABLE mtb_wday ( 
    1183     id int2, 
    1184     name text, 
    1185     rank int2 NOT NULL DEFAULT 0, 
     1183    id smallint, 
     1184    name text, 
     1185    rank smallint NOT NULL DEFAULT 0, 
    11861186    PRIMARY KEY (id) 
    11871187); 
    11881188 
    11891189CREATE TABLE mtb_delivery_date ( 
    1190     id int2, 
    1191     name text, 
    1192     rank int2 NOT NULL DEFAULT 0, 
     1190    id smallint, 
     1191    name text, 
     1192    rank smallint NOT NULL DEFAULT 0, 
    11931193    PRIMARY KEY (id) 
    11941194); 
    11951195 
    11961196CREATE TABLE mtb_product_list_max ( 
    1197     id int2, 
    1198     name text, 
    1199     rank int2 NOT NULL DEFAULT 0, 
     1197    id smallint, 
     1198    name text, 
     1199    rank smallint NOT NULL DEFAULT 0, 
    12001200    PRIMARY KEY (id) 
    12011201); 
    12021202 
    12031203CREATE TABLE mtb_convenience ( 
    1204     id int2, 
    1205     name text, 
    1206     rank int2 NOT NULL DEFAULT 0, 
     1204    id smallint, 
     1205    name text, 
     1206    rank smallint NOT NULL DEFAULT 0, 
    12071207    PRIMARY KEY (id) 
    12081208); 
    12091209 
    12101210CREATE TABLE mtb_conveni_message ( 
    1211     id int2, 
    1212     name text, 
    1213     rank int2 NOT NULL DEFAULT 0, 
     1211    id smallint, 
     1212    name text, 
     1213    rank smallint NOT NULL DEFAULT 0, 
    12141214    PRIMARY KEY (id) 
    12151215); 
    12161216 
    12171217CREATE TABLE mtb_db ( 
    1218     id int2, 
    1219     name text, 
    1220     rank int2 NOT NULL DEFAULT 0, 
     1218    id smallint, 
     1219    name text, 
     1220    rank smallint NOT NULL DEFAULT 0, 
    12211221    PRIMARY KEY (id) 
    12221222); 
    12231223 
    12241224CREATE TABLE mtb_target ( 
    1225     id int2, 
    1226     name text, 
    1227     rank int2 NOT NULL DEFAULT 0, 
     1225    id smallint, 
     1226    name text, 
     1227    rank smallint NOT NULL DEFAULT 0, 
    12281228    PRIMARY KEY (id) 
    12291229); 
    12301230 
    12311231CREATE TABLE mtb_review_deny_url ( 
    1232     id int2, 
    1233     name text, 
    1234     rank int2 NOT NULL DEFAULT 0, 
     1232    id smallint, 
     1233    name text, 
     1234    rank smallint NOT NULL DEFAULT 0, 
    12351235    PRIMARY KEY (id) 
    12361236); 
    12371237 
    12381238CREATE TABLE mtb_track_back_status ( 
    1239     id int2, 
    1240     name text, 
    1241     rank int2 NOT NULL DEFAULT 0, 
     1239    id smallint, 
     1240    name text, 
     1241    rank smallint NOT NULL DEFAULT 0, 
    12421242    PRIMARY KEY (id) 
    12431243); 
    12441244 
    12451245CREATE TABLE mtb_site_control_track_back ( 
    1246     id int2, 
    1247     name text, 
    1248     rank int2 NOT NULL DEFAULT 0, 
     1246    id smallint, 
     1247    name text, 
     1248    rank smallint NOT NULL DEFAULT 0, 
    12491249    PRIMARY KEY (id) 
    12501250); 
    12511251 
    12521252CREATE TABLE mtb_site_control_affiliate ( 
    1253     id int2, 
    1254     name text, 
    1255     rank int2 NOT NULL DEFAULT 0, 
     1253    id smallint, 
     1254    name text, 
     1255    rank smallint NOT NULL DEFAULT 0, 
    12561256    PRIMARY KEY (id) 
    12571257); 
    12581258 
    12591259CREATE TABLE mtb_mobile_domain ( 
    1260     id int2, 
    1261     name text, 
    1262     rank int2 NOT NULL DEFAULT 0, 
     1260    id smallint, 
     1261    name text, 
     1262    rank smallint NOT NULL DEFAULT 0, 
    12631263    PRIMARY KEY (id) 
    12641264); 
     
    12671267    id text, 
    12681268    name text, 
    1269     rank int2 NOT NULL DEFAULT 0, 
     1269    rank smallint NOT NULL DEFAULT 0, 
    12701270    PRIMARY KEY (id) 
    12711271); 
     
    12741274    id text, 
    12751275    name text, 
    1276     rank int2 NOT NULL DEFAULT 0, 
     1276    rank smallint NOT NULL DEFAULT 0, 
    12771277    PRIMARY KEY (id) 
    12781278); 
     
    12811281    id text, 
    12821282    name text, 
    1283     rank int2 NOT NULL DEFAULT 0, 
     1283    rank smallint NOT NULL DEFAULT 0, 
    12841284    remarks text, 
    12851285    PRIMARY KEY (id) 
Note: See TracChangeset for help on using the changeset viewer.