source: branches/version-2_5-dev/html/install/sql/create_table_mysql.sql @ 19890

Revision 19890, 31.6 KB checked in by nanasess, 13 years ago (diff)

#843(複数配送先の指定)

  • 非会員購入時, 別のお届け先を指定した場合に複数配送扱いになってしまうのを修正
  • 非会員購入時, お届け先住所が保存されないのを修正
  • ER図を修正
  • Property svn:eol-style set to LF
  • Property svn:mime-type set to text/plain; charset=utf-8
Line 
1create table dtb_module_update_logs(
2    log_id int  NOT NULL,
3    module_id int NOT NULL,
4    buckup_path text,
5    error_flg smallint DEFAULT 0,
6    error text,
7    ok text,
8    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
9    update_date timestamp NOT NULL,
10    PRIMARY KEY (log_id)
11) ENGINE=InnoDB;
12
13CREATE TABLE dtb_ownersstore_settings (
14    public_key text
15) ENGINE=InnoDB;
16
17CREATE TABLE dtb_kiyaku (
18    kiyaku_id int  NOT NULL,
19    kiyaku_title text NOT NULL,
20    kiyaku_text text NOT NULL,
21    rank int NOT NULL DEFAULT 0,
22    creator_id int NOT NULL,
23    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
24    update_date timestamp NOT NULL,
25    del_flg smallint NOT NULL DEFAULT 0,
26    PRIMARY KEY (kiyaku_id)
27) ENGINE=InnoDB;
28
29CREATE TABLE dtb_holiday (
30    holiday_id int  NOT NULL,
31    title text 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,
36    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
37    update_date timestamp NOT NULL,
38    del_flg smallint NOT NULL DEFAULT 0,
39    PRIMARY KEY (holiday_id)
40) ENGINE=InnoDB;
41
42CREATE TABLE mtb_zip (
43    code text,
44    old_zipcode text,
45    zipcode text,
46    state_kana text,
47    city_kana text,
48    town_kana text,
49    state text,
50    city text,
51    town text,
52    flg1 text,
53    flg2 text,
54    flg3 text,
55    flg4 text,
56    flg5 text,
57    flg6 text
58) ENGINE=InnoDB;
59
60CREATE TABLE dtb_bat_order_daily_age (
61    order_count numeric NOT NULL DEFAULT 0,
62    total numeric NOT NULL DEFAULT 0,
63    total_average numeric NOT NULL DEFAULT 0,
64    start_age smallint,
65    end_age smallint,
66    member smallint,
67    order_date datetime,
68    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
69) ENGINE=InnoDB;
70
71CREATE TABLE dtb_update (
72    module_id int NOT NULL,
73    module_name text NOT NULL,
74    now_version text,
75    latest_version text NOT NULL,
76    module_explain text,
77    main_php text NOT NULL,
78    extern_php text NOT NULL,
79    install_sql text,
80    uninstall_sql text,
81    other_files text,
82    del_flg smallint NOT NULL DEFAULT 0,
83    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
84    update_date timestamp NOT NULL,
85    release_date datetime NOT NULL,
86    PRIMARY KEY (module_id)
87) ENGINE=InnoDB;
88
89CREATE TABLE dtb_baseinfo (
90    company_name text,
91    company_kana text,
92    zip01 text,
93    zip02 text,
94    pref smallint,
95    addr01 text,
96    addr02 text,
97    tel01 text,
98    tel02 text,
99    tel03 text,
100    fax01 text,
101    fax02 text,
102    fax03 text,
103    business_hour text,
104    law_company text,
105    law_manager text,
106    law_zip01 text,
107    law_zip02 text,
108    law_pref smallint,
109    law_addr01 text,
110    law_addr02 text,
111    law_tel01 text,
112    law_tel02 text,
113    law_tel03 text,
114    law_fax01 text,
115    law_fax02 text,
116    law_fax03 text,
117    law_email text,
118    law_url text,
119    law_term01 text,
120    law_term02 text,
121    law_term03 text,
122    law_term04 text,
123    law_term05 text,
124    law_term06 text,
125    law_term07 text,
126    law_term08 text,
127    law_term09 text,
128    law_term10 text,
129    tax numeric NOT NULL DEFAULT 5,
130    tax_rule smallint NOT NULL DEFAULT 1,
131    email01 text,
132    email02 text,
133    email03 text,
134    email04 text,
135    email05 text,
136    free_rule numeric,
137    shop_name text,
138    shop_kana text,
139    shop_name_eng text,
140    point_rate numeric NOT NULL DEFAULT 0,
141    welcome_point numeric NOT NULL DEFAULT 0,
142    update_date timestamp NOT NULL,
143    top_tpl text,
144    product_tpl text,
145    detail_tpl text,
146    mypage_tpl text,
147    good_traded text,
148    message text,
149    regular_holiday_ids text,
150    latitude text,
151    longitude text,
152    downloadable_days numeric DEFAULT 30,
153    downloadable_days_unlimited smallint
154) ENGINE=InnoDB;
155
156CREATE TABLE dtb_deliv (
157    deliv_id int  NOT NULL,
158    product_type_id int,
159    name text,
160    service_name text,
161    confirm_url text,
162    rank int,
163    status smallint NOT NULL DEFAULT 1,
164    del_flg smallint NOT NULL DEFAULT 0,
165    creator_id int NOT NULL,
166    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
167    update_date timestamp NOT NULL,
168    PRIMARY KEY (deliv_id)
169) ENGINE=InnoDB;
170
171CREATE TABLE dtb_delivtime (
172    deliv_id int NOT NULL,
173    time_id int NOT NULL,
174    deliv_time text NOT NULL,
175    PRIMARY KEY (deliv_id, time_id)
176) ENGINE=InnoDB;
177
178CREATE TABLE dtb_delivfee (
179    deliv_id int NOT NULL,
180    fee_id int  NOT NULL,
181    fee numeric NOT NULL,
182    pref smallint,
183    PRIMARY KEY (deliv_id, fee_id)
184) ENGINE=InnoDB;
185
186CREATE TABLE dtb_payment (
187    payment_id int  NOT NULL,
188    payment_method text,
189    charge numeric,
190    rule numeric,
191    rank int,
192    note text,
193    fix smallint,
194    status smallint NOT NULL DEFAULT 1,
195    del_flg smallint NOT NULL DEFAULT 0,
196    creator_id int NOT NULL,
197    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
198    update_date timestamp NOT NULL,
199    payment_image text,
200    upper_rule numeric,
201    charge_flg smallint DEFAULT 1,
202    rule_min numeric,
203    upper_rule_max numeric,
204    module_id int,
205    module_path text,
206    memo01 text,
207    memo02 text,
208    memo03 text,
209    memo04 text,
210    memo05 text,
211    memo06 text,
212    memo07 text,
213    memo08 text,
214    memo09 text,
215    memo10 text,
216    PRIMARY KEY (payment_id)
217) ENGINE=InnoDB;
218
219CREATE TABLE dtb_payment_options (
220    product_class_id int NOT NULL,
221    payment_id int NOT NULL,
222    rank int,
223    PRIMARY KEY(product_class_id, payment_id)
224) ENGINE=InnoDB;
225
226CREATE TABLE dtb_mailtemplate (
227    template_id int NOT NULL,
228    subject text,
229    header text,
230    footer text,
231    creator_id int NOT NULL,
232    del_flg smallint NOT NULL DEFAULT 0,
233    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
234    update_date timestamp NOT NULL
235) ENGINE=InnoDB;
236
237CREATE TABLE dtb_send_history (
238    send_id int  NOT NULL,
239    mail_method smallint,
240    subject text,
241    body text,
242    send_count int,
243    complete_count int NOT NULL DEFAULT 0,
244    start_date datetime,
245    end_date datetime,
246    search_data text,
247    del_flg smallint NOT NULL DEFAULT 0,
248    creator_id int NOT NULL,
249    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
250    update_date timestamp NOT NULL,
251    PRIMARY KEY (send_id)
252) ENGINE=InnoDB;
253
254CREATE TABLE dtb_send_customer (
255    customer_id int,
256    send_id int NOT NULL,
257    email text,
258    name text,
259    send_flag smallint,
260    PRIMARY KEY (send_id, customer_id)
261) ENGINE=InnoDB;
262
263CREATE TABLE dtb_products (
264    product_id int  NOT NULL,
265    name text NOT NULL,
266    maker_id int,
267    status smallint NOT NULL DEFAULT 2,
268    comment1 text,
269    comment2 text,
270    comment3 mediumtext,
271    comment4 text,
272    comment5 text,
273    comment6 text,
274    note text,
275    main_list_comment text,
276    main_list_image text,
277    main_comment mediumtext,
278    main_image text,
279    main_large_image text,
280    sub_title1 text,
281    sub_comment1 mediumtext,
282    sub_image1 text,
283    sub_large_image1 text,
284    sub_title2 text,
285    sub_comment2 mediumtext,
286    sub_image2 text,
287    sub_large_image2 text,
288    sub_title3 text,
289    sub_comment3 mediumtext,
290    sub_image3 text,
291    sub_large_image3 text,
292    sub_title4 text,
293    sub_comment4 mediumtext,
294    sub_image4 text,
295    sub_large_image4 text,
296    sub_title5 text,
297    sub_comment5 mediumtext,
298    sub_image5 text,
299    sub_large_image5 text,
300    sub_title6 text,
301    sub_comment6 mediumtext,
302    sub_image6 text,
303    sub_large_image6 text,
304    del_flg smallint NOT NULL DEFAULT 0,
305    creator_id int NOT NULL,
306    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
307    update_date timestamp NOT NULL,
308    deliv_date_id int,
309    PRIMARY KEY (product_id)
310) ENGINE=InnoDB;
311
312CREATE TABLE dtb_products_class (
313    product_class_id int  NOT NULL,
314    product_id int NOT NULL,
315    class_combination_id int,
316    product_type_id int NOT NULL DEFAULT 0,
317    product_code text,
318    stock numeric,
319    stock_unlimited smallint NOT NULL DEFAULT 0,
320    sale_limit numeric,
321    price01 numeric,
322    price02 numeric NOT NULL,
323    deliv_fee numeric,
324    point_rate numeric,
325    creator_id int NOT NULL,
326    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
327    update_date timestamp NOT NULL,
328    down_filename text,
329    down_realfilename text,
330    del_flg smallint NOT NULL DEFAULT 0,
331    PRIMARY KEY (product_class_id)
332) ENGINE=InnoDB;
333
334CREATE TABLE dtb_class (
335    class_id int  NOT NULL,
336    name text,
337    rank int,
338    creator_id int NOT NULL,
339    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
340    update_date timestamp NOT NULL,
341    del_flg smallint NOT NULL DEFAULT 0,
342    PRIMARY KEY (class_id)
343) ENGINE=InnoDB;
344
345CREATE TABLE dtb_classcategory (
346    classcategory_id int  NOT NULL,
347    name text,
348    class_id int NOT NULL,
349    rank int,
350    creator_id int NOT NULL,
351    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
352    update_date timestamp NOT NULL,
353    del_flg smallint NOT NULL DEFAULT 0,
354    PRIMARY KEY (classcategory_id)
355) ENGINE=InnoDB;
356
357CREATE TABLE dtb_class_combination (
358    class_combination_id int NOT NULL,
359    parent_class_combination_id int,
360    classcategory_id int NOT NULL,
361    level int,
362    PRIMARY KEY(class_combination_id)
363) ENGINE=InnoDB;
364
365CREATE TABLE dtb_category (
366    category_id int  NOT NULL,
367    category_name text,
368    parent_category_id int NOT NULL DEFAULT 0,
369    level int NOT NULL,
370    rank int,
371    creator_id int NOT NULL,
372    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
373    update_date timestamp NOT NULL,
374    del_flg smallint NOT NULL DEFAULT 0,
375    PRIMARY KEY (category_id)
376) ENGINE=InnoDB;
377
378CREATE TABLE dtb_product_categories (
379    product_id int NOT NULL,
380    category_id int NOT NULL,
381    rank int NOT NULL,
382    PRIMARY KEY(product_id, category_id)
383) ENGINE=InnoDB;
384
385CREATE TABLE dtb_product_status (
386    product_status_id smallint NOT NULL,
387    product_id int NOT NULL,
388    creator_id int NOT NULL,
389    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
390    update_date timestamp NOT NULL,
391    del_flg smallint NOT NULL DEFAULT 0,
392    PRIMARY KEY(product_status_id, product_id)
393) ENGINE=InnoDB;
394
395CREATE TABLE dtb_bat_order_daily (
396    total_order numeric NOT NULL DEFAULT 0,
397    member numeric NOT NULL DEFAULT 0,
398    nonmember numeric NOT NULL DEFAULT 0,
399    men numeric NOT NULL DEFAULT 0,
400    women numeric NOT NULL DEFAULT 0,
401    men_member numeric NOT NULL DEFAULT 0,
402    men_nonmember numeric NOT NULL DEFAULT 0,
403    women_member numeric NOT NULL DEFAULT 0,
404    women_nonmember numeric NOT NULL DEFAULT 0,
405    total numeric NOT NULL DEFAULT 0,
406    total_average numeric NOT NULL DEFAULT 0,
407    order_date datetime NOT NULL,
408    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
409    year smallint NOT NULL,
410    month smallint NOT NULL,
411    day smallint NOT NULL,
412    wday smallint NOT NULL,
413    key_day text NOT NULL,
414    key_month text NOT NULL,
415    key_year text NOT NULL,
416    key_wday text NOT NULL
417) ENGINE=InnoDB;
418
419CREATE TABLE dtb_bat_order_daily_hour (
420    total_order numeric NOT NULL DEFAULT 0,
421    member numeric NOT NULL DEFAULT 0,
422    nonmember numeric NOT NULL DEFAULT 0,
423    men numeric NOT NULL DEFAULT 0,
424    women numeric NOT NULL DEFAULT 0,
425    men_member numeric NOT NULL DEFAULT 0,
426    men_nonmember numeric NOT NULL DEFAULT 0,
427    women_member numeric NOT NULL DEFAULT 0,
428    women_nonmember numeric NOT NULL DEFAULT 0,
429    total numeric NOT NULL DEFAULT 0,
430    total_average numeric NOT NULL DEFAULT 0,
431    hour smallint NOT NULL DEFAULT 0,
432    order_date datetime,
433    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
434) ENGINE=InnoDB;
435
436CREATE TABLE dtb_recommend_products (
437    product_id int NOT NULL,
438    recommend_product_id int NOT NULL,
439    rank int NOT NULL,
440    comment text,
441    status smallint NOT NULL DEFAULT 0,
442    creator_id int NOT NULL,
443    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
444    update_date timestamp NOT NULL
445) ENGINE=InnoDB;
446
447CREATE TABLE dtb_review (
448    review_id int  NOT NULL,
449    product_id int NOT NULL,
450    reviewer_name text NOT NULL,
451    reviewer_url text,
452    sex smallint,
453    customer_id int,
454    recommend_level smallint NOT NULL,
455    title text NOT NULL,
456    comment text NOT NULL,
457    status smallint DEFAULT 2,
458    creator_id int NOT NULL,
459    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
460    update_date timestamp NOT NULL,
461    del_flg smallint NOT NULL DEFAULT 0,
462    PRIMARY KEY (review_id)
463) ENGINE=InnoDB;
464
465CREATE TABLE dtb_customer_favorite_products (
466    customer_id int NOT NULL,
467    product_id int NOT NULL,
468    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
469    update_date timestamp NOT NULL
470) ENGINE=InnoDB;
471
472CREATE TABLE dtb_category_count (
473    category_id int NOT NULL,
474    product_count int NOT NULL,
475    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
476) ENGINE=InnoDB;
477
478CREATE TABLE dtb_category_total_count (
479    category_id int NOT NULL,
480    product_count int,
481    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
482) ENGINE=InnoDB;
483
484CREATE TABLE dtb_news (
485    news_id int  NOT NULL,
486    news_date datetime,
487    rank int,
488    news_title text NOT NULL,
489    news_comment text,
490    news_url text,
491    news_select smallint NOT NULL DEFAULT 0,
492    link_method text,
493    creator_id int NOT NULL,
494    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
495    update_date timestamp NOT NULL,
496    del_flg smallint NOT NULL DEFAULT 0,
497    PRIMARY KEY (news_id)
498) ENGINE=InnoDB;
499
500CREATE TABLE dtb_best_products (
501    best_id int  NOT NULL,
502    category_id int NOT NULL,
503    rank int NOT NULL DEFAULT 0,
504    product_id int NOT NULL,
505    title text,
506    comment text,
507    creator_id int NOT NULL,
508    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
509    update_date timestamp NOT NULL,
510    del_flg smallint NOT NULL DEFAULT 0,
511    PRIMARY KEY (best_id)
512) ENGINE=InnoDB;
513
514CREATE TABLE dtb_mail_history (
515    send_id int  NOT NULL,
516    order_id int NOT NULL,
517    send_date datetime,
518    template_id int,
519    creator_id int NOT NULL,
520    subject text,
521    mail_body text,
522    PRIMARY KEY (send_id)
523) ENGINE=InnoDB;
524
525CREATE TABLE dtb_customer (
526    customer_id int  NOT NULL,
527    name01 text NOT NULL,
528    name02 text NOT NULL,
529    kana01 text NOT NULL,
530    kana02 text NOT NULL,
531    zip01 text,
532    zip02 text,
533    pref smallint,
534    addr01 text,
535    addr02 text,
536    email text NOT NULL,
537    email_mobile text,
538    tel01 text,
539    tel02 text,
540    tel03 text,
541    fax01 text,
542    fax02 text,
543    fax03 text,
544    sex smallint,
545    job smallint,
546    birth datetime,
547    password text,
548    reminder smallint,
549    reminder_answer text,
550    secret_key varchar(50) NOT NULL UNIQUE,
551    first_buy_date datetime,
552    last_buy_date datetime,
553    buy_times numeric DEFAULT 0,
554    buy_total numeric DEFAULT 0,
555    point numeric DEFAULT 0,
556    note text,
557    status smallint NOT NULL DEFAULT 1,
558    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
559    update_date timestamp NOT NULL,
560    del_flg smallint NOT NULL DEFAULT 0,
561    mobile_phone_id text,
562    mailmaga_flg smallint,
563    PRIMARY KEY (customer_id)
564) ENGINE=InnoDB;
565
566CREATE TABLE dtb_order (
567    order_id int  NOT NULL,
568    order_temp_id text,
569    customer_id int NOT NULL,
570    message text,
571    order_name01 text,
572    order_name02 text,
573    order_kana01 text,
574    order_kana02 text,
575    order_email text,
576    order_tel01 text,
577    order_tel02 text,
578    order_tel03 text,
579    order_fax01 text,
580    order_fax02 text,
581    order_fax03 text,
582    order_zip01 text,
583    order_zip02 text,
584    order_pref smallint,
585    order_addr01 text,
586    order_addr02 text,
587    order_sex smallint,
588    order_birth datetime,
589    order_job int,
590    subtotal numeric,
591    discount numeric,
592    charge numeric,
593    use_point numeric,
594    add_point numeric,
595    birth_point numeric DEFAULT 0,
596    tax numeric,
597    total numeric,
598    payment_total numeric,
599    payment_id int,
600    payment_method text,
601    note text,
602    status smallint,
603    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
604    update_date timestamp NOT NULL,
605    commit_date datetime,
606    payment_date datetime,
607    device_type_id int,
608    del_flg smallint NOT NULL DEFAULT 0,
609    memo01 text,
610    memo02 text,
611    memo03 text,
612    memo04 text,
613    memo05 text,
614    memo06 text,
615    memo07 text,
616    memo08 text,
617    memo09 text,
618    memo10 text,
619    PRIMARY KEY (order_id)
620) ENGINE=InnoDB;
621
622CREATE TABLE dtb_order_temp (
623    order_temp_id text NOT NULL,
624    customer_id int NOT NULL,
625    message text,
626    order_name01 text,
627    order_name02 text,
628    order_kana01 text,
629    order_kana02 text,
630    order_email text,
631    order_tel01 text,
632    order_tel02 text,
633    order_tel03 text,
634    order_fax01 text,
635    order_fax02 text,
636    order_fax03 text,
637    order_zip01 text,
638    order_zip02 text,
639    order_pref smallint,
640    order_addr01 text,
641    order_addr02 text,
642    order_sex smallint,
643    order_birth datetime,
644    order_job int,
645    subtotal numeric,
646    discount numeric,
647    charge numeric,
648    use_point numeric,
649    add_point numeric,
650    birth_point numeric DEFAULT 0,
651    tax numeric,
652    total numeric,
653    payment_total numeric,
654    payment_id int,
655    payment_method text,
656    note text,
657    mail_flag smallint,
658    status smallint,
659    deliv_check smallint,
660    point_check smallint,
661    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
662    update_date timestamp NOT NULL,
663    device_type_id int,
664    del_flg smallint NOT NULL DEFAULT 0,
665    order_id int,
666    memo01 text,
667    memo02 text,
668    memo03 text,
669    memo04 text,
670    memo05 text,
671    memo06 text,
672    memo07 text,
673    memo08 text,
674    memo09 text,
675    memo10 text,
676    session text
677) ENGINE=InnoDB;
678
679CREATE TABLE dtb_shipping (
680    shipping_id int NOT NULL,
681    order_id int NOT NULL,
682    shipping_name01 text,
683    shipping_name02 text,
684    shipping_kana01 text,
685    shipping_kana02 text,
686    shipping_tel01 text,
687    shipping_tel02 text,
688    shipping_tel03 text,
689    shipping_fax01 text,
690    shipping_fax02 text,
691    shipping_fax03 text,
692    shipping_pref smallint,
693    shipping_zip01 text,
694    shipping_zip02 text,
695    shipping_addr01 text,
696    shipping_addr02 text,
697    deliv_id int NOT NULL,
698    time_id int,
699    shipping_fee NUMERIC,
700    shipping_time TEXT,
701    shipping_num TEXT,
702    shipping_date datetime,
703    shipping_commit_date datetime,
704    rank int,
705    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
706    update_date timestamp NOT NULL,
707    del_flg smallint NOT NULL DEFAULT 0,
708    PRIMARY KEY (shipping_id, order_id)
709) ENGINE=InnoDB;
710
711CREATE TABLE dtb_shipment_item (
712    shipping_id int NOT NULL,
713    product_class_id int NOT NULL,
714    order_id int NOT NULL,
715    product_name text NOT NULL,
716    product_code text,
717    classcategory_name1 text,
718    classcategory_name2 text,
719    price numeric,
720    quantity numeric,
721    PRIMARY KEY (shipping_id, product_class_id, order_id)
722) ENGINE=InnoDB;
723
724CREATE TABLE dtb_other_deliv (
725    other_deliv_id int  NOT NULL,
726    customer_id int NOT NULL,
727    name01 text,
728    name02 text,
729    kana01 text,
730    kana02 text,
731    zip01 text,
732    zip02 text,
733    pref smallint,
734    addr01 text,
735    addr02 text,
736    tel01 text,
737    tel02 text,
738    tel03 text,
739    PRIMARY KEY (other_deliv_id)
740) ENGINE=InnoDB;
741
742CREATE TABLE dtb_order_detail (
743    order_id int NOT NULL,
744    product_id int NOT NULL,
745    product_class_id int NOT NULL,
746    product_name text NOT NULL,
747    product_code text,
748    classcategory_name1 text,
749    classcategory_name2 text,
750    price numeric,
751    quantity numeric,
752    point_rate numeric
753) ENGINE=InnoDB;
754
755CREATE TABLE dtb_member (
756    member_id int  NOT NULL,
757    name text,
758    department text,
759    login_id text NOT NULL,
760    password text NOT NULL,
761    authority smallint NOT NULL,
762    rank int NOT NULL DEFAULT 0,
763    work smallint NOT NULL DEFAULT 1,
764    del_flg smallint NOT NULL DEFAULT 0,
765    creator_id int NOT NULL,
766    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
767    update_date timestamp NOT NULL,
768    login_date datetime,
769    PRIMARY KEY (member_id)
770) ENGINE=InnoDB;
771
772CREATE TABLE dtb_bat_relate_products (
773    product_id int,
774    relate_product_id int,
775    customer_id int,
776    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
777) ENGINE=InnoDB;
778
779CREATE TABLE dtb_pagelayout (
780    device_type_id int NOT NULL,
781    page_id int  NOT NULL,
782    page_name text,
783    url text NOT NULL,
784    php_dir text,
785    tpl_dir text,
786    filename text,
787    header_chk smallint DEFAULT 1,
788    footer_chk smallint DEFAULT 1,
789    edit_flg smallint DEFAULT 1,
790    author text,
791    description text,
792    keyword text,
793    update_url text,
794    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
795    update_date timestamp NOT NULL,
796    PRIMARY KEY (device_type_id, page_id)
797) ENGINE=InnoDB;
798
799CREATE TABLE dtb_bloc (
800    device_type_id int NOT NULL,
801    bloc_id int  NOT NULL,
802    bloc_name text,
803    tpl_path text,
804    filename varchar(50) NOT NULL,
805    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
806    update_date timestamp NOT NULL,
807    php_path text,
808    deletable_flg smallint NOT NULL DEFAULT 1,
809    PRIMARY KEY (device_type_id, bloc_id),
810    UNIQUE (device_type_id, filename)
811) ENGINE=InnoDB;
812
813CREATE TABLE dtb_blocposition (
814    device_type_id int NOT NULL,
815    page_id int NOT NULL,
816    target_id int NOT NULL,
817    bloc_id int NOT NULL,
818    bloc_row int,
819    anywhere smallint DEFAULT 0 NOT NULL,
820    PRIMARY KEY (device_type_id, page_id, target_id, bloc_id)
821) ENGINE=InnoDB;
822
823CREATE TABLE dtb_csv (
824    no int,
825    csv_id int NOT NULL,
826    col text,
827    disp_name text,
828    rank int,
829    rw_flg smallint DEFAULT 1,
830    status smallint NOT NULL DEFAULT 1,
831    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
832    update_date timestamp NOT NULL,
833    mb_convert_kana_option text,
834    size_const_type text,
835    error_check_types text,
836    PRIMARY KEY (no)
837) ENGINE=InnoDB;
838
839CREATE TABLE dtb_csv_sql (
840    sql_id int,
841    sql_name text NOT NULL,
842    csv_sql text,
843    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
844    update_date timestamp NOT NULL,
845    PRIMARY KEY (sql_id)
846) ENGINE=InnoDB;
847
848CREATE TABLE dtb_templates (
849    template_code varchar(50) NOT NULL,
850    template_name text,
851    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
852    update_date timestamp NOT NULL,
853    PRIMARY KEY (template_code)
854) ENGINE=InnoDB;
855
856CREATE TABLE dtb_table_comment (
857    id int,
858    table_name text,
859    column_name text,
860    description text,
861    PRIMARY KEY (id)
862) ENGINE=InnoDB;
863
864CREATE TABLE dtb_maker (
865    maker_id int NOT NULL,
866    name text NOT NULL,
867    rank int NOT NULL DEFAULT 0,
868    creator_id int NOT NULL,
869    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
870    update_date timestamp NOT NULL,
871    del_flg smallint NOT NULL DEFAULT 0,
872    PRIMARY KEY (maker_id)
873) ENGINE=InnoDB;
874
875CREATE TABLE dtb_maker_count (
876    maker_id int NOT NULL,
877    product_count int NOT NULL,
878    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
879) ENGINE=InnoDB;
880
881CREATE TABLE mtb_pref (
882    id smallint NOT NULL,
883    name text,
884    rank smallint NOT NULL DEFAULT 0,
885    PRIMARY KEY (id)
886) ENGINE=InnoDB;
887
888CREATE TABLE mtb_permission (
889    id text,
890    name text,
891    rank smallint NOT NULL DEFAULT 0,
892    PRIMARY KEY (id(32))
893) ENGINE=InnoDB;
894
895CREATE TABLE mtb_disable_logout (
896    id smallint,
897    name text,
898    rank smallint NOT NULL DEFAULT 0,
899    PRIMARY KEY (id)
900) ENGINE=InnoDB;
901
902CREATE TABLE mtb_authority (
903    id smallint,
904    name text,
905    rank smallint NOT NULL DEFAULT 0,
906    PRIMARY KEY (id)
907) ENGINE=InnoDB;
908
909CREATE TABLE mtb_work (
910    id smallint,
911    name text,
912    rank smallint NOT NULL DEFAULT 0,
913    PRIMARY KEY (id)
914) ENGINE=InnoDB;
915
916CREATE TABLE mtb_disp (
917    id smallint,
918    name text,
919    rank smallint NOT NULL DEFAULT 0,
920    PRIMARY KEY (id)
921) ENGINE=InnoDB;
922
923CREATE TABLE mtb_class (
924    id smallint,
925    name text,
926    rank smallint NOT NULL DEFAULT 0,
927    PRIMARY KEY (id)
928) ENGINE=InnoDB;
929
930CREATE TABLE mtb_status (
931    id smallint,
932    name text,
933    rank smallint NOT NULL DEFAULT 0,
934    PRIMARY KEY (id)
935) ENGINE=InnoDB;
936
937CREATE TABLE mtb_status_image (
938    id smallint,
939    name text,
940    rank smallint NOT NULL DEFAULT 0,
941    PRIMARY KEY (id)
942) ENGINE=InnoDB;
943
944CREATE TABLE mtb_allowed_tag (
945    id smallint,
946    name text,
947    rank smallint NOT NULL DEFAULT 0,
948    PRIMARY KEY (id)
949) ENGINE=InnoDB;
950
951CREATE TABLE mtb_page_max (
952    id smallint,
953    name text,
954    rank smallint NOT NULL DEFAULT 0,
955    PRIMARY KEY (id)
956) ENGINE=InnoDB;
957
958CREATE TABLE mtb_magazine_type (
959    id smallint,
960    name text,
961    rank smallint NOT NULL DEFAULT 0,
962    PRIMARY KEY (id)
963) ENGINE=InnoDB;
964
965CREATE TABLE mtb_mail_magazine_type (
966    id smallint,
967    name text,
968    rank smallint NOT NULL DEFAULT 0,
969    PRIMARY KEY (id)
970) ENGINE=InnoDB;
971
972CREATE TABLE mtb_recommend (
973    id smallint,
974    name text,
975    rank smallint NOT NULL DEFAULT 0,
976    PRIMARY KEY (id)
977) ENGINE=InnoDB;
978
979CREATE TABLE mtb_taxrule (
980    id smallint,
981    name text,
982    rank smallint NOT NULL DEFAULT 0,
983    PRIMARY KEY (id)
984) ENGINE=InnoDB;
985
986CREATE TABLE mtb_mail_template (
987    id smallint,
988    name text,
989    rank smallint NOT NULL DEFAULT 0,
990    PRIMARY KEY (id)
991) ENGINE=InnoDB;
992
993CREATE TABLE mtb_mail_tpl_path (
994    id smallint,
995    name text,
996    rank smallint NOT NULL DEFAULT 0,
997    PRIMARY KEY (id)
998) ENGINE=InnoDB;
999
1000CREATE TABLE mtb_job (
1001    id smallint,
1002    name text,
1003    rank smallint NOT NULL DEFAULT 0,
1004    PRIMARY KEY (id)
1005) ENGINE=InnoDB;
1006
1007CREATE TABLE mtb_reminder (
1008    id smallint,
1009    name text,
1010    rank smallint NOT NULL DEFAULT 0,
1011    PRIMARY KEY (id)
1012) ENGINE=InnoDB;
1013
1014CREATE TABLE mtb_sex (
1015    id smallint,
1016    name text,
1017    rank smallint NOT NULL DEFAULT 0,
1018    PRIMARY KEY (id)
1019) ENGINE=InnoDB;
1020
1021CREATE TABLE mtb_page_rows (
1022    id smallint,
1023    name text,
1024    rank smallint NOT NULL DEFAULT 0,
1025    PRIMARY KEY (id)
1026) ENGINE=InnoDB;
1027
1028CREATE TABLE mtb_mail_type (
1029    id smallint,
1030    name text,
1031    rank smallint NOT NULL DEFAULT 0,
1032    PRIMARY KEY (id)
1033) ENGINE=InnoDB;
1034
1035CREATE TABLE mtb_order_status (
1036    id smallint,
1037    name text,
1038    rank smallint NOT NULL DEFAULT 0,
1039    PRIMARY KEY (id)
1040) ENGINE=InnoDB;
1041
1042CREATE TABLE mtb_product_status_color (
1043    id smallint,
1044    name text,
1045    rank smallint NOT NULL DEFAULT 0,
1046    PRIMARY KEY (id)
1047) ENGINE=InnoDB;
1048
1049CREATE TABLE mtb_order_status_color (
1050    id smallint,
1051    name text,
1052    rank smallint NOT NULL DEFAULT 0,
1053    PRIMARY KEY (id)
1054) ENGINE=InnoDB;
1055
1056CREATE TABLE mtb_wday (
1057    id smallint,
1058    name text,
1059    rank smallint NOT NULL DEFAULT 0,
1060    PRIMARY KEY (id)
1061) ENGINE=InnoDB;
1062
1063CREATE TABLE mtb_delivery_date (
1064    id smallint,
1065    name text,
1066    rank smallint NOT NULL DEFAULT 0,
1067    PRIMARY KEY (id)
1068) ENGINE=InnoDB;
1069
1070CREATE TABLE mtb_product_list_max (
1071    id smallint,
1072    name text,
1073    rank smallint NOT NULL DEFAULT 0,
1074    PRIMARY KEY (id)
1075) ENGINE=InnoDB;
1076
1077CREATE TABLE mtb_convenience (
1078    id smallint,
1079    name text,
1080    rank smallint NOT NULL DEFAULT 0,
1081    PRIMARY KEY (id)
1082) ENGINE=InnoDB;
1083
1084CREATE TABLE mtb_conveni_message (
1085    id smallint,
1086    name text,
1087    rank smallint NOT NULL DEFAULT 0,
1088    PRIMARY KEY (id)
1089) ENGINE=InnoDB;
1090
1091CREATE TABLE mtb_db (
1092    id smallint,
1093    name text,
1094    rank smallint NOT NULL DEFAULT 0,
1095    PRIMARY KEY (id)
1096) ENGINE=InnoDB;
1097
1098CREATE TABLE mtb_target (
1099    id smallint,
1100    name text,
1101    rank smallint NOT NULL DEFAULT 0,
1102    PRIMARY KEY (id)
1103) ENGINE=InnoDB;
1104
1105CREATE TABLE mtb_review_deny_url (
1106    id smallint,
1107    name text,
1108    rank smallint NOT NULL DEFAULT 0,
1109    PRIMARY KEY (id)
1110) ENGINE=InnoDB;
1111
1112CREATE TABLE mtb_track_back_status (
1113    id smallint,
1114    name text,
1115    rank smallint NOT NULL DEFAULT 0,
1116    PRIMARY KEY (id)
1117) ENGINE=InnoDB;
1118
1119CREATE TABLE mtb_site_control_track_back (
1120    id smallint,
1121    name text,
1122    rank smallint NOT NULL DEFAULT 0,
1123    PRIMARY KEY (id)
1124) ENGINE=InnoDB;
1125
1126CREATE TABLE mtb_site_control_affiliate (
1127    id smallint,
1128    name text,
1129    rank smallint NOT NULL DEFAULT 0,
1130    PRIMARY KEY (id)
1131) ENGINE=InnoDB;
1132
1133CREATE TABLE mtb_mobile_domain (
1134    id smallint,
1135    name text,
1136    rank smallint NOT NULL DEFAULT 0,
1137    PRIMARY KEY (id)
1138) ENGINE=InnoDB;
1139
1140CREATE TABLE mtb_ownersstore_err (
1141    id smallint,
1142    name text,
1143    rank smallint NOT NULL DEFAULT 0,
1144    PRIMARY KEY (id)
1145) ENGINE=InnoDB;
1146
1147CREATE TABLE mtb_ownersstore_ips (
1148    id smallint,
1149    name text,
1150    rank smallint NOT NULL DEFAULT 0,
1151    PRIMARY KEY (id)
1152) ENGINE=InnoDB;
1153
1154CREATE TABLE mtb_constants (
1155    id text,
1156    name text,
1157    rank smallint NOT NULL DEFAULT 0,
1158    remarks text,
1159    PRIMARY KEY (id(64))
1160) ENGINE=InnoDB;
1161
1162CREATE TABLE mtb_product_type (
1163    id smallint,
1164    name text,
1165    rank smallint NOT NULL,
1166    PRIMARY KEY (id)
1167) ENGINE=InnoDB;
1168
1169CREATE TABLE mtb_device_type (
1170    id smallint,
1171    name text,
1172    rank smallint NOT NULL,
1173    PRIMARY KEY (id)
1174) ENGINE=InnoDB;
1175
1176CREATE TABLE dtb_mobile_ext_session_id (
1177    session_id text NOT NULL,
1178    param_key text,
1179    param_value text,
1180    url text,
1181    create_date timestamp NOT NULL DEFAULT now()
1182);
1183
1184CREATE TABLE dtb_mobile_kara_mail (
1185    kara_mail_id serial PRIMARY KEY,
1186    session_id text NOT NULL,
1187    token text NOT NULL,
1188    next_url text NOT NULL,
1189    create_date timestamp NOT NULL DEFAULT now(),
1190    email text,
1191    receive_date timestamp
1192);
1193
1194CREATE TABLE dtb_module (
1195    module_id int NOT NULL UNIQUE,
1196    module_code text NOT NULL,
1197    module_name text NOT NULL,
1198    sub_data text,
1199    auto_update_flg smallint NOT NULL DEFAULT 0,
1200    del_flg smallint NOT NULL DEFAULT 0,
1201    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1202    update_date timestamp NOT NULL
1203) ENGINE=InnoDB;
1204
1205CREATE TABLE dtb_session (
1206    sess_id varchar(50) NOT NULL,
1207    sess_data text,
1208    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1209    update_date timestamp NOT NULL,
1210    PRIMARY KEY (sess_id)
1211) ENGINE=InnoDB;
1212
1213CREATE TABLE dtb_site_control (
1214    control_id int NOT NULL,
1215    control_title varchar(255),
1216    control_text text,
1217    control_flg smallint NOT NULL DEFAULT 2,
1218    del_flg smallint NOT NULL DEFAULT 0,
1219    memo text,
1220    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1221    update_date timestamp NOT NULL,
1222    PRIMARY KEY (control_id)
1223) ENGINE=InnoDB;
1224
1225CREATE TABLE dtb_trackback (
1226    trackback_id int  NOT NULL,
1227    product_id int NOT NULL,
1228    blog_name varchar(255) NOT NULL,
1229    title varchar(255) NOT NULL,
1230    excerpt text NOT NULL,
1231    url text NOT NULL,
1232    status smallint NOT NULL DEFAULT 2,
1233    del_flg smallint NOT NULL DEFAULT 0,
1234    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1235    update_date timestamp NOT NULL,
1236    PRIMARY KEY (trackback_id)
1237) ENGINE=InnoDB;
1238
1239CREATE TABLE dtb_bkup (
1240    bkup_name varchar(50),
1241    bkup_memo text,
1242    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1243    PRIMARY KEY (bkup_name)
1244) ENGINE=InnoDB;
1245
1246CREATE TABLE dtb_plugin (
1247    plugin_id int NOT NULL,
1248    plugin_name varchar(255) NOT NULL,
1249    enable smallint NOT NULL DEFAULT 0,
1250    del_flg smallint NOT NULL DEFAULT 0,
1251    class_name varchar(255) NOT NULL,
1252    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1253    update_date timestamp NOT NULL,
1254    PRIMARY KEY (plugin_id)
1255) ENGINE=InnoDB;
1256
1257CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64));
1258CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id);
1259CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
1260CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
1261CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key(64));
1262CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value(64));
1263CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url(64));
1264CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date);
1265CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token(64));
1266CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date);
1267CREATE INDEX dtb_mobile_kara_mail_receive_date_key ON dtb_mobile_kara_mail (receive_date);
1268
1269CREATE TABLE dtb_index_list (
1270    table_name varchar(30) NOT NULL DEFAULT '',
1271    column_name varchar(30) NOT NULL DEFAULT '',
1272    recommend_flg smallint NOT NULL DEFAULT 0,
1273    recommend_comment text,
1274    PRIMARY KEY (table_name, column_name)
1275) ENGINE=InnoDB;
Note: See TracBrowser for help on using the repository browser.