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

Revision 23475, 29.4 KB checked in by shutta, 10 years ago (diff)

#2488 mtb_ownersstore_ipsの削除
mtb_ownersstore_ipsマスターに関連する部分を全て削除。

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