source: branches/version-2_12-dev/html/install/sql/create_table_pgsql.sql @ 21810

Revision 21810, 28.2 KB checked in by nanasess, 11 years ago (diff)

#1573 プライマリーキーが無いテーブルの改善

  • dtb_baseinfo, mtb_zip にはプライマリーキーとなるカラムを追加

#800 SQL標準に準拠する

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