source: branches/version-2_13-dev/html/install/sql/create_table_pgsql.sql @ 22843

Revision 22843, 29.3 KB checked in by Seasoft, 8 years ago (diff)

#2044 (無駄な処理を改善する for 2.13.0)

  • 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)
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 timestamp 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    free_rule numeric,
118    shop_name text,
119    shop_kana text,
120    shop_name_eng text,
121    point_rate numeric NOT NULL DEFAULT 0,
122    welcome_point numeric NOT NULL DEFAULT 0,
123    update_date timestamp NOT NULL,
124    top_tpl text,
125    product_tpl text,
126    detail_tpl text,
127    mypage_tpl text,
128    good_traded text,
129    message text,
130    regular_holiday_ids text,
131    latitude text,
132    longitude text,
133    downloadable_days numeric DEFAULT 30,
134    downloadable_days_unlimited smallint,
135    PRIMARY KEY (id)
136);
137
138CREATE TABLE dtb_deliv (
139    deliv_id int NOT NULL,
140    product_type_id int,
141    name text,
142    service_name text,
143    remark text,
144    confirm_url text,
145    rank int,
146    status smallint NOT NULL DEFAULT 1,
147    del_flg smallint NOT NULL DEFAULT 0,
148    creator_id int NOT NULL,
149    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
150    update_date timestamp NOT NULL,
151    PRIMARY KEY (deliv_id)
152);
153
154CREATE TABLE dtb_payment_options (
155    deliv_id int NOT NULL,
156    payment_id int NOT NULL,
157    rank int,
158    PRIMARY KEY (deliv_id, payment_id)
159);
160
161CREATE TABLE dtb_delivtime (
162    deliv_id int NOT NULL,
163    time_id int NOT NULL,
164    deliv_time text NOT NULL,
165    PRIMARY KEY (deliv_id, time_id)
166);
167
168CREATE TABLE dtb_delivfee (
169    deliv_id int NOT NULL,
170    fee_id int NOT NULL,
171    fee numeric NOT NULL,
172    pref smallint,
173    PRIMARY KEY (deliv_id, fee_id)
174);
175
176CREATE TABLE dtb_payment (
177    payment_id int NOT NULL,
178    payment_method text,
179    charge numeric,
180    rule_max numeric,
181    rank int,
182    note text,
183    fix smallint,
184    status smallint NOT NULL DEFAULT 1,
185    del_flg smallint NOT NULL DEFAULT 0,
186    creator_id int NOT NULL,
187    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
188    update_date timestamp NOT NULL,
189    payment_image text,
190    upper_rule numeric,
191    charge_flg smallint DEFAULT 1,
192    rule_min numeric,
193    upper_rule_max numeric,
194    module_id int,
195    module_path text,
196    memo01 text,
197    memo02 text,
198    memo03 text,
199    memo04 text,
200    memo05 text,
201    memo06 text,
202    memo07 text,
203    memo08 text,
204    memo09 text,
205    memo10 text,
206    PRIMARY KEY (payment_id)
207);
208
209CREATE TABLE dtb_mailtemplate (
210    template_id int NOT NULL,
211    subject text,
212    header text,
213    footer text,
214    creator_id int NOT NULL,
215    del_flg smallint NOT NULL DEFAULT 0,
216    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
217    update_date timestamp NOT NULL,
218    PRIMARY KEY (template_id)
219);
220
221CREATE TABLE dtb_mailmaga_template (
222    template_id int NOT NULL,
223    subject text,
224    mail_method int,
225    body text,
226    del_flg smallint NOT NULL DEFAULT 0,
227    creator_id int NOT NULL,
228    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
229    update_date timestamp NOT NULL,
230    PRIMARY KEY (template_id)
231);
232
233CREATE TABLE dtb_send_history (
234    send_id int NOT NULL,
235    mail_method smallint,
236    subject text,
237    body text,
238    send_count int,
239    complete_count int NOT NULL DEFAULT 0,
240    start_date timestamp,
241    end_date timestamp,
242    search_data text,
243    del_flg smallint NOT NULL DEFAULT 0,
244    creator_id int NOT NULL,
245    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
246    update_date timestamp NOT NULL,
247    PRIMARY KEY (send_id)
248);
249
250CREATE TABLE dtb_send_customer (
251    customer_id int NOT NULL,
252    send_id int NOT NULL,
253    email text,
254    name text,
255    send_flag smallint,
256    PRIMARY KEY (send_id, customer_id)
257);
258
259CREATE TABLE dtb_products (
260    product_id int NOT NULL,
261    name text NOT NULL,
262    maker_id int,
263    status smallint NOT NULL DEFAULT 2,
264    comment1 text,
265    comment2 text,
266    comment3 text,
267    comment4 text,
268    comment5 text,
269    comment6 text,
270    note text,
271    main_list_comment text,
272    main_list_image text,
273    main_comment text,
274    main_image text,
275    main_large_image text,
276    sub_title1 text,
277    sub_comment1 text,
278    sub_image1 text,
279    sub_large_image1 text,
280    sub_title2 text,
281    sub_comment2 text,
282    sub_image2 text,
283    sub_large_image2 text,
284    sub_title3 text,
285    sub_comment3 text,
286    sub_image3 text,
287    sub_large_image3 text,
288    sub_title4 text,
289    sub_comment4 text,
290    sub_image4 text,
291    sub_large_image4 text,
292    sub_title5 text,
293    sub_comment5 text,
294    sub_image5 text,
295    sub_large_image5 text,
296    sub_title6 text,
297    sub_comment6 text,
298    sub_image6 text,
299    sub_large_image6 text,
300    del_flg smallint NOT NULL DEFAULT 0,
301    creator_id int NOT NULL,
302    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
303    update_date timestamp NOT NULL,
304    deliv_date_id int,
305    PRIMARY KEY (product_id)
306);
307
308CREATE TABLE dtb_products_class (
309    product_class_id int NOT NULL,
310    product_id int NOT NULL,
311    classcategory_id1 int NOT NULL DEFAULT 0,
312    classcategory_id2 int NOT NULL DEFAULT 0,
313    product_type_id int NOT NULL DEFAULT 0,
314    product_code text,
315    stock numeric,
316    stock_unlimited smallint NOT NULL DEFAULT 0,
317    sale_limit numeric,
318    price01 numeric,
319    price02 numeric NOT NULL,
320    deliv_fee numeric,
321    point_rate numeric NOT NULL DEFAULT 0,
322    creator_id int NOT NULL,
323    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
324    update_date timestamp NOT NULL,
325    down_filename text,
326    down_realfilename text,
327    del_flg smallint NOT NULL DEFAULT 0,
328    PRIMARY KEY (product_class_id),
329    UNIQUE (product_id, classcategory_id1, classcategory_id2)
330);
331
332CREATE TABLE dtb_class (
333    class_id int NOT NULL,
334    name text,
335    rank int,
336    creator_id int NOT NULL,
337    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
338    update_date timestamp NOT NULL,
339    del_flg smallint NOT NULL DEFAULT 0,
340    PRIMARY KEY (class_id)
341);
342
343CREATE TABLE dtb_classcategory (
344    classcategory_id int NOT NULL,
345    name text,
346    class_id int NOT NULL,
347    rank int,
348    creator_id int NOT NULL,
349    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
350    update_date timestamp NOT NULL,
351    del_flg smallint NOT NULL DEFAULT 0,
352    PRIMARY KEY (classcategory_id)
353);
354
355CREATE TABLE dtb_category (
356    category_id int NOT NULL,
357    category_name text,
358    parent_category_id int NOT NULL DEFAULT 0,
359    level int NOT NULL,
360    rank int,
361    creator_id int NOT NULL,
362    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
363    update_date timestamp NOT NULL,
364    del_flg smallint NOT NULL DEFAULT 0,
365    PRIMARY KEY (category_id)
366);
367
368CREATE TABLE dtb_product_categories (
369    product_id int NOT NULL,
370    category_id int NOT NULL,
371    rank int NOT NULL,
372    PRIMARY KEY(product_id, category_id)
373);
374
375CREATE TABLE dtb_product_status (
376    product_status_id smallint NOT NULL,
377    product_id int NOT NULL,
378    creator_id int NOT NULL,
379    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
380    update_date timestamp NOT NULL,
381    del_flg smallint NOT NULL DEFAULT 0,
382    PRIMARY KEY (product_status_id, product_id)
383);
384
385CREATE TABLE dtb_recommend_products (
386    product_id int NOT NULL,
387    recommend_product_id int NOT NULL,
388    rank int NOT NULL,
389    comment text,
390    status smallint NOT NULL DEFAULT 0,
391    creator_id int NOT NULL,
392    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
393    update_date timestamp NOT NULL,
394    PRIMARY KEY (product_id, recommend_product_id)
395);
396
397CREATE TABLE dtb_review (
398    review_id int NOT NULL,
399    product_id int NOT NULL,
400    reviewer_name text NOT NULL,
401    reviewer_url text,
402    sex smallint,
403    customer_id int,
404    recommend_level smallint NOT NULL,
405    title text NOT NULL,
406    comment text NOT NULL,
407    status smallint DEFAULT 2,
408    creator_id int NOT NULL,
409    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
410    update_date timestamp NOT NULL,
411    del_flg smallint NOT NULL DEFAULT 0,
412    PRIMARY KEY (review_id)
413);
414
415CREATE TABLE dtb_customer_favorite_products (
416    customer_id int NOT NULL,
417    product_id int NOT NULL,
418    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
419    update_date timestamp NOT NULL,
420    PRIMARY KEY (customer_id, product_id)
421);
422
423CREATE TABLE dtb_category_count (
424    category_id int NOT NULL,
425    product_count int NOT NULL,
426    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
427    PRIMARY KEY (category_id)
428);
429
430CREATE TABLE dtb_category_total_count (
431    category_id int NOT NULL,
432    product_count int,
433    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
434    PRIMARY KEY (category_id)
435);
436
437CREATE TABLE dtb_news (
438    news_id int NOT NULL,
439    news_date timestamp,
440    rank int,
441    news_title text NOT NULL,
442    news_comment text,
443    news_url text,
444    news_select smallint NOT NULL DEFAULT 0,
445    link_method text,
446    creator_id int NOT NULL,
447    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
448    update_date timestamp NOT NULL,
449    del_flg smallint NOT NULL DEFAULT 0,
450    PRIMARY KEY (news_id)
451);
452
453CREATE TABLE dtb_best_products (
454    best_id int NOT NULL,
455    category_id int NOT NULL,
456    rank int NOT NULL DEFAULT 0,
457    product_id int NOT NULL,
458    title text,
459    comment text,
460    creator_id int NOT NULL,
461    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
462    update_date timestamp NOT NULL,
463    del_flg smallint NOT NULL DEFAULT 0,
464    PRIMARY KEY (best_id)
465);
466
467CREATE TABLE dtb_mail_history (
468    send_id int NOT NULL,
469    order_id int NOT NULL,
470    send_date timestamp,
471    template_id int,
472    creator_id int NOT NULL,
473    subject text,
474    mail_body text,
475    PRIMARY KEY (send_id)
476);
477
478CREATE TABLE dtb_customer (
479    customer_id int NOT NULL,
480    name01 text NOT NULL,
481    name02 text NOT NULL,
482    kana01 text NOT NULL,
483    kana02 text NOT NULL,
484    zip01 text,
485    zip02 text,
486    country_id int,
487    pref smallint,
488    addr01 text,
489    addr02 text,
490    email text NOT NULL,
491    email_mobile text,
492    tel01 text,
493    tel02 text,
494    tel03 text,
495    fax01 text,
496    fax02 text,
497    fax03 text,
498    sex smallint,
499    job smallint,
500    birth timestamp,
501    password text,
502    reminder smallint,
503    reminder_answer text,
504    salt text,
505    secret_key text NOT NULL,
506    first_buy_date timestamp,
507    last_buy_date timestamp,
508    buy_times numeric DEFAULT 0,
509    buy_total numeric DEFAULT 0,
510    point numeric NOT NULL DEFAULT 0,
511    note text,
512    status smallint NOT NULL DEFAULT 1,
513    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
514    update_date timestamp NOT NULL,
515    del_flg smallint NOT NULL DEFAULT 0,
516    mobile_phone_id text,
517    mailmaga_flg smallint,
518    PRIMARY KEY (customer_id),
519    UNIQUE (secret_key)
520);
521
522CREATE TABLE dtb_order (
523    order_id int NOT NULL,
524    order_temp_id text,
525    customer_id int NOT NULL,
526    message text,
527    order_name01 text,
528    order_name02 text,
529    order_kana01 text,
530    order_kana02 text,
531    order_email text,
532    order_tel01 text,
533    order_tel02 text,
534    order_tel03 text,
535    order_fax01 text,
536    order_fax02 text,
537    order_fax03 text,
538    order_zip01 text,
539    order_zip02 text,
540    order_country_id int,
541    order_pref smallint,
542    order_addr01 text,
543    order_addr02 text,
544    order_sex smallint,
545    order_birth timestamp,
546    order_job int,
547    subtotal numeric,
548    discount numeric NOT NULL DEFAULT 0,
549    deliv_id int,
550    deliv_fee numeric,
551    charge numeric,
552    use_point numeric NOT NULL DEFAULT 0,
553    add_point numeric NOT NULL DEFAULT 0,
554    birth_point numeric NOT NULL DEFAULT 0,
555    tax numeric,
556    order_tax_rate numeric,
557    order_tax_rule smallint,
558    total numeric,
559    payment_total numeric,
560    payment_id int,
561    payment_method text,
562    note text,
563    status smallint,
564    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
565    update_date timestamp NOT NULL,
566    commit_date timestamp,
567    payment_date timestamp,
568    device_type_id int,
569    del_flg smallint NOT NULL DEFAULT 0,
570    memo01 text,
571    memo02 text,
572    memo03 text,
573    memo04 text,
574    memo05 text,
575    memo06 text,
576    memo07 text,
577    memo08 text,
578    memo09 text,
579    memo10 text,
580    PRIMARY KEY (order_id)
581);
582
583CREATE TABLE dtb_order_temp (
584    order_temp_id text NOT NULL,
585    customer_id int NOT NULL,
586    message text,
587    order_name01 text,
588    order_name02 text,
589    order_kana01 text,
590    order_kana02 text,
591    order_email text,
592    order_tel01 text,
593    order_tel02 text,
594    order_tel03 text,
595    order_fax01 text,
596    order_fax02 text,
597    order_fax03 text,
598    order_zip01 text,
599    order_zip02 text,
600    order_country_id int,
601    order_pref smallint,
602    order_addr01 text,
603    order_addr02 text,
604    order_sex smallint,
605    order_birth timestamp,
606    order_job int,
607    subtotal numeric,
608    discount numeric NOT NULL DEFAULT 0,
609    deliv_id int,
610    deliv_fee numeric,
611    charge numeric,
612    use_point numeric NOT NULL DEFAULT 0,
613    add_point numeric NOT NULL DEFAULT 0,
614    birth_point numeric NOT NULL DEFAULT 0,
615    tax numeric,
616    order_tax_rate numeric,
617    order_tax_rule smallint,
618    total numeric,
619    payment_total numeric,
620    payment_id int,
621    payment_method text,
622    note text,
623    mail_flag smallint,
624    status smallint,
625    deliv_check smallint,
626    point_check smallint,
627    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
628    update_date timestamp NOT NULL,
629    device_type_id int,
630    del_flg smallint NOT NULL DEFAULT 0,
631    order_id int,
632    memo01 text,
633    memo02 text,
634    memo03 text,
635    memo04 text,
636    memo05 text,
637    memo06 text,
638    memo07 text,
639    memo08 text,
640    memo09 text,
641    memo10 text,
642    session text,
643    PRIMARY KEY (order_temp_id)
644);
645
646CREATE TABLE dtb_shipping (
647    shipping_id int NOT NULL,
648    order_id int NOT NULL,
649    shipping_name01 text,
650    shipping_name02 text,
651    shipping_kana01 text,
652    shipping_kana02 text,
653    shipping_tel01 text,
654    shipping_tel02 text,
655    shipping_tel03 text,
656    shipping_fax01 text,
657    shipping_fax02 text,
658    shipping_fax03 text,
659    shipping_country_id int,
660    shipping_pref smallint,
661    shipping_zip01 text,
662    shipping_zip02 text,
663    shipping_addr01 text,
664    shipping_addr02 text,
665    time_id int,
666    shipping_time text,
667    shipping_num text,
668    shipping_date timestamp,
669    shipping_commit_date timestamp,
670    rank int,
671    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
672    update_date timestamp NOT NULL,
673    del_flg smallint NOT NULL DEFAULT 0,
674    PRIMARY KEY (shipping_id, order_id)
675);
676
677CREATE TABLE dtb_shipment_item (
678    shipping_id int NOT NULL,
679    product_class_id int NOT NULL,
680    order_id int NOT NULL,
681    product_name text NOT NULL,
682    product_code text,
683    classcategory_name1 text,
684    classcategory_name2 text,
685    price numeric,
686    quantity numeric,
687    PRIMARY KEY (shipping_id, product_class_id, order_id)
688);
689
690CREATE TABLE dtb_other_deliv (
691    other_deliv_id int NOT NULL,
692    customer_id int NOT NULL,
693    name01 text,
694    name02 text,
695    kana01 text,
696    kana02 text,
697    zip01 text,
698    zip02 text,
699    country_id int,
700    pref smallint,
701    addr01 text,
702    addr02 text,
703    tel01 text,
704    tel02 text,
705    tel03 text,
706    fax01 text,
707    fax02 text,
708    fax03 text,
709    PRIMARY KEY (other_deliv_id)
710);
711
712CREATE TABLE dtb_order_detail (
713    order_detail_id int NOT NULL,
714    order_id int NOT NULL,
715    product_id int NOT NULL,
716    product_class_id int NOT NULL,
717    product_name text NOT NULL,
718    product_code text,
719    classcategory_name1 text,
720    classcategory_name2 text,
721    price numeric,
722    quantity numeric,
723    point_rate numeric NOT NULL DEFAULT 0,
724    tax_rate numeric,
725    tax_rule smallint,
726    PRIMARY KEY (order_detail_id)
727);
728
729CREATE TABLE dtb_member (
730    member_id int NOT NULL,
731    name text,
732    department text,
733    login_id text NOT NULL,
734    password text NOT NULL,
735    salt text NOT NULL,
736    authority smallint NOT NULL,
737    rank int NOT NULL DEFAULT 0,
738    work smallint NOT NULL DEFAULT 1,
739    del_flg smallint NOT NULL DEFAULT 0,
740    creator_id int NOT NULL,
741    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
742    update_date timestamp NOT NULL,
743    login_date timestamp,
744    PRIMARY KEY (member_id)
745);
746
747CREATE TABLE dtb_pagelayout (
748    device_type_id int NOT NULL,
749    page_id int NOT NULL,
750    page_name text,
751    url text NOT NULL,
752    filename text,
753    header_chk smallint DEFAULT 1,
754    footer_chk smallint DEFAULT 1,
755    edit_flg smallint DEFAULT 1,
756    author text,
757    description text,
758    keyword text,
759    update_url text,
760    create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
761    update_date timestamp NOT NULL,
762    meta_robots text,
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)
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)
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)
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)
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)
1124);
1125
1126CREATE TABLE dtb_module (
1127    module_id int NOT NULL,
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)
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)
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, column_name)
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);
1236CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
1237CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
1238CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key);
1239CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value);
1240CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url);
1241CREATE 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.