source: branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql @ 19890

Revision 19890, 29.6 KB checked in by nanasess, 13 years ago (diff)

#843(複数配送先の指定)

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