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

Revision 21502, 26.9 KB checked in by Seasoft, 12 years ago (diff)

#1641 (商品規格における木構造の廃止)

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