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

Revision 20160, 31.0 KB checked in by AMUAMU, 11 years ago (diff)

#965 (リファクタリング [管理画面]顧客管理) LC_Page_Admin_Customer.php 修正
#850 (顧客CSV 列追加時にロジックの変更を不要に) の対応
#657 (CSVダウンロードの改善) に関するリファクタリング
#812 (管理画面でトランザクションIDを使用する)に対応

SC_Helper_mail::sfSendRegistMail() の追加(登録/仮登録メール送信)
SC_Helper_Customer::sfGetCustomerDataFromId() の追加(ただし他のリファクタリングと被ったので後日再リファクタリング必要)

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