source: branches/camp/camp-2_13-tax/html/install/sql/create_table_mysql.sql @ 22637

Revision 22637, 29.5 KB checked in by tao, 11 years ago (diff)

とりあえず国マスタと会員情報に国IDを追加

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