source: branches/version-2_13-dev/html/install/sql/create_table_mysql.sql @ 22736

Revision 22736, 29.5 KB checked in by h_yoshimoto, 9 years ago (diff)

#2193 税率チームのコミットをマージ(from camp/camp-2_13-tax)

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