source: branches/version-2_5-dev/html/install/sql/create_table_mysql.sql @ 19736

Revision 19736, 29.8 KB checked in by Seasoft, 13 years ago (diff)

#627(ソース整形・ソースコメントの改善)
#554(MySQL と PostgreSQL でテーブル定義が異なる)

  • 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 datetime NOT NULL,
9    update_date datetime NOT NULL,
10    PRIMARY KEY (log_id)
11) TYPE=InnoDB;
12
13CREATE TABLE dtb_ownersstore_settings (
14    public_key text
15) TYPE=InnoDB;
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 datetime NOT NULL,
24    update_date datetime NOT NULL,
25    del_flg smallint NOT NULL DEFAULT 0,
26    PRIMARY KEY (kiyaku_id)
27) TYPE=InnoDB;
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 datetime NOT NULL,
37    update_date datetime NOT NULL,
38    del_flg smallint NOT NULL DEFAULT 0,
39    PRIMARY KEY (holiday_id)
40) TYPE=InnoDB;
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) TYPE=InnoDB;
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 datetime,
68    create_date datetime NOT NULL
69) TYPE=InnoDB;
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 datetime NOT NULL,
84    update_date datetime,
85    release_date datetime NOT NULL,
86    PRIMARY KEY (module_id)
87) TYPE=InnoDB;
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 datetime,
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) TYPE=InnoDB;
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 datetime NOT NULL,
167    update_date datetime,
168    PRIMARY KEY (deliv_id)
169) TYPE=InnoDB;
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) TYPE=InnoDB;
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) TYPE=InnoDB;
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 datetime NOT NULL,
198    update_date datetime,
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) TYPE=InnoDB;
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) TYPE=InnoDB;
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 datetime NOT NULL,
234    update_date datetime NOT NULL
235) TYPE=InnoDB;
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 datetime,
245    end_date datetime,
246    search_data text,
247    del_flg smallint NOT NULL DEFAULT 0,
248    creator_id int NOT NULL,
249    create_date datetime NOT NULL,
250    update_date datetime NOT NULL,
251    PRIMARY KEY (send_id)
252) TYPE=InnoDB;
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) TYPE=InnoDB;
262
263CREATE TABLE dtb_products (
264    product_id int  NOT NULL,
265    name text NOT NULL,
266    maker_id int,
267    rank int,
268    status smallint NOT NULL DEFAULT 2,
269    comment1 text,
270    comment2 text,
271    comment3 mediumtext,
272    comment4 text,
273    comment5 text,
274    comment6 text,
275    note text,
276    main_list_comment text,
277    main_list_image text,
278    main_comment mediumtext,
279    main_image text,
280    main_large_image text,
281    sub_title1 text,
282    sub_comment1 mediumtext,
283    sub_image1 text,
284    sub_large_image1 text,
285    sub_title2 text,
286    sub_comment2 mediumtext,
287    sub_image2 text,
288    sub_large_image2 text,
289    sub_title3 text,
290    sub_comment3 mediumtext,
291    sub_image3 text,
292    sub_large_image3 text,
293    sub_title4 text,
294    sub_comment4 mediumtext,
295    sub_image4 text,
296    sub_large_image4 text,
297    sub_title5 text,
298    sub_comment5 mediumtext,
299    sub_image5 text,
300    sub_large_image5 text,
301    sub_title6 text,
302    sub_comment6 mediumtext,
303    sub_image6 text,
304    sub_large_image6 text,
305    del_flg smallint NOT NULL DEFAULT 0,
306    creator_id int NOT NULL,
307    create_date datetime NOT NULL,
308    update_date datetime,
309    deliv_date_id int,
310    PRIMARY KEY (product_id)
311) TYPE=InnoDB;
312
313CREATE TABLE dtb_products_class (
314    product_class_id int  NOT NULL,
315    product_id int NOT NULL,
316    class_combination_id int,
317    product_type_id int NOT NULL DEFAULT 0,
318    product_code text,
319    stock numeric,
320    stock_unlimited smallint NOT NULL DEFAULT 0,
321    sale_limit numeric,
322    price01 numeric,
323    price02 numeric NOT NULL,
324    deliv_fee numeric,
325    point_rate numeric,
326    creator_id int NOT NULL,
327    create_date datetime NOT NULL,
328    update_date datetime,
329    down_filename text,
330    down_realfilename text,
331    del_flg smallint NOT NULL DEFAULT 0,
332    PRIMARY KEY (product_class_id)
333) TYPE=InnoDB;
334
335CREATE TABLE dtb_class (
336    class_id int  NOT NULL,
337    name text,
338    rank int,
339    creator_id int NOT NULL,
340    create_date datetime NOT NULL,
341    update_date datetime,
342    del_flg smallint NOT NULL DEFAULT 0,
343    PRIMARY KEY (class_id)
344) TYPE=InnoDB;
345
346CREATE TABLE dtb_classcategory (
347    classcategory_id int  NOT NULL,
348    name text,
349    class_id int NOT NULL,
350    rank int,
351    creator_id int NOT NULL,
352    create_date datetime NOT NULL,
353    update_date datetime,
354    del_flg smallint NOT NULL DEFAULT 0,
355    PRIMARY KEY (classcategory_id)
356) TYPE=InnoDB;
357
358CREATE TABLE dtb_class_combination (
359    class_combination_id int NOT NULL,
360    parent_class_combination_id int,
361    classcategory_id int NOT NULL,
362    level int,
363    PRIMARY KEY(class_combination_id)
364) TYPE=InnoDB;
365
366CREATE TABLE dtb_category (
367    category_id int  NOT NULL,
368    category_name text,
369    parent_category_id int NOT NULL DEFAULT 0,
370    level int NOT NULL,
371    rank int,
372    creator_id int NOT NULL,
373    create_date datetime NOT NULL,
374    update_date datetime,
375    del_flg smallint NOT NULL DEFAULT 0,
376    PRIMARY KEY (category_id)
377) TYPE=InnoDB;
378
379CREATE TABLE dtb_product_categories (
380    product_id int NOT NULL,
381    category_id int NOT NULL,
382    rank int NOT NULL,
383    PRIMARY KEY(product_id, category_id)
384) TYPE=InnoDB;
385
386CREATE TABLE dtb_product_status (
387    product_status_id smallint NOT NULL,
388    product_id int NOT NULL,
389    creator_id int NOT NULL,
390    create_date datetime NOT NULL,
391    update_date datetime,
392    del_flg smallint NOT NULL DEFAULT 0,
393    PRIMARY KEY(product_status_id, product_id)
394) TYPE=InnoDB;
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 datetime NOT NULL,
409    create_date datetime NOT NULL,
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) TYPE=InnoDB;
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 datetime,
434    create_date datetime NOT NULL
435) TYPE=InnoDB;
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 datetime NOT NULL,
445    update_date datetime NOT NULL
446) TYPE=InnoDB;
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 datetime,
461    update_date datetime,
462    del_flg smallint NOT NULL DEFAULT 0,
463    PRIMARY KEY (review_id)
464) TYPE=InnoDB;
465
466CREATE TABLE dtb_customer_favorite_products (
467    customer_id int NOT NULL,
468    product_id int NOT NULL,
469    create_date datetime NOT NULL,
470    update_date datetime NOT NULL
471) TYPE=InnoDB;
472
473CREATE TABLE dtb_category_count (
474    category_id int NOT NULL,
475    product_count int NOT NULL,
476    create_date datetime NOT NULL
477) TYPE=InnoDB;
478
479CREATE TABLE dtb_category_total_count (
480    category_id int NOT NULL,
481    product_count int,
482    create_date datetime NOT NULL
483) TYPE=InnoDB;
484
485CREATE TABLE dtb_news (
486    news_id int  NOT NULL,
487    news_date datetime,
488    rank int,
489    news_title text NOT NULL,
490    news_comment text,
491    news_url text,
492    news_select smallint NOT NULL DEFAULT 0,
493    link_method text,
494    creator_id int NOT NULL,
495    create_date datetime NOT NULL,
496    update_date datetime,
497    del_flg smallint NOT NULL DEFAULT 0,
498    PRIMARY KEY (news_id)
499) TYPE=InnoDB;
500
501CREATE TABLE dtb_best_products (
502    best_id int  NOT NULL,
503    category_id int NOT NULL,
504    rank int NOT NULL DEFAULT 0,
505    product_id int NOT NULL,
506    title text,
507    comment text,
508    creator_id int NOT NULL,
509    create_date datetime NOT NULL,
510    update_date datetime,
511    del_flg smallint NOT NULL DEFAULT 0,
512    PRIMARY KEY (best_id)
513) TYPE=InnoDB;
514
515CREATE TABLE dtb_mail_history (
516    send_id int  NOT NULL,
517    order_id int NOT NULL,
518    send_date datetime,
519    template_id int,
520    creator_id int NOT NULL,
521    subject text,
522    mail_body text,
523    PRIMARY KEY (send_id)
524) TYPE=InnoDB;
525
526CREATE TABLE dtb_customer (
527    customer_id int  NOT NULL,
528    name01 text NOT NULL,
529    name02 text NOT NULL,
530    kana01 text NOT NULL,
531    kana02 text NOT NULL,
532    zip01 text,
533    zip02 text,
534    pref smallint,
535    addr01 text,
536    addr02 text,
537    email text NOT NULL,
538    email_mobile text,
539    tel01 text,
540    tel02 text,
541    tel03 text,
542    fax01 text,
543    fax02 text,
544    fax03 text,
545    sex smallint,
546    job smallint,
547    birth datetime,
548    password text,
549    reminder smallint,
550    reminder_answer text,
551    secret_key varchar(50) NOT NULL UNIQUE,
552    first_buy_date datetime,
553    last_buy_date datetime,
554    buy_times numeric DEFAULT 0,
555    buy_total numeric DEFAULT 0,
556    point numeric DEFAULT 0,
557    note text,
558    status smallint NOT NULL DEFAULT 1,
559    create_date datetime NOT NULL,
560    update_date datetime,
561    del_flg smallint NOT NULL DEFAULT 0,
562    mobile_phone_id text,
563    mailmaga_flg smallint,
564    PRIMARY KEY (customer_id)
565) TYPE=InnoDB;
566
567CREATE TABLE dtb_order (
568    order_id int  NOT NULL,
569    order_temp_id text,
570    customer_id int NOT NULL,
571    message text,
572    order_name01 text,
573    order_name02 text,
574    order_kana01 text,
575    order_kana02 text,
576    order_email text,
577    order_tel01 text,
578    order_tel02 text,
579    order_tel03 text,
580    order_fax01 text,
581    order_fax02 text,
582    order_fax03 text,
583    order_zip01 text,
584    order_zip02 text,
585    order_pref smallint,
586    order_addr01 text,
587    order_addr02 text,
588    order_sex smallint,
589    order_birth datetime,
590    order_job int,
591    deliv_name01 text,
592    deliv_name02 text,
593    deliv_kana01 text,
594    deliv_kana02 text,
595    deliv_tel01 text,
596    deliv_tel02 text,
597    deliv_tel03 text,
598    deliv_fax01 text,
599    deliv_fax02 text,
600    deliv_fax03 text,
601    deliv_zip01 text,
602    deliv_zip02 text,
603    deliv_pref smallint,
604    deliv_addr01 text,
605    deliv_addr02 text,
606    subtotal numeric,
607    discount numeric,
608    deliv_fee numeric,
609    charge numeric,
610    use_point numeric,
611    add_point numeric,
612    birth_point numeric DEFAULT 0,
613    tax numeric,
614    total numeric,
615    payment_total numeric,
616    payment_id int,
617    payment_method text,
618    deliv_id int,
619    deliv_time_id int,
620    deliv_time text,
621    deliv_no text,
622    note text,
623    status smallint,
624    create_date datetime NOT NULL,
625    update_date datetime,
626    commit_date datetime,
627    payment_date datetime,
628    device_type_id int,
629    del_flg smallint NOT NULL DEFAULT 0,
630    deliv_date text,
631    memo01 text,
632    memo02 text,
633    memo03 text,
634    memo04 text,
635    memo05 text,
636    memo06 text,
637    memo07 text,
638    memo08 text,
639    memo09 text,
640    memo10 text,
641    PRIMARY KEY (order_id)
642) TYPE=InnoDB;
643
644CREATE TABLE dtb_order_temp (
645    order_temp_id text NOT NULL,
646    customer_id int NOT NULL,
647    message text,
648    order_name01 text,
649    order_name02 text,
650    order_kana01 text,
651    order_kana02 text,
652    order_email text,
653    order_tel01 text,
654    order_tel02 text,
655    order_tel03 text,
656    order_fax01 text,
657    order_fax02 text,
658    order_fax03 text,
659    order_zip01 text,
660    order_zip02 text,
661    order_pref smallint,
662    order_addr01 text,
663    order_addr02 text,
664    order_sex smallint,
665    order_birth datetime,
666    order_job int,
667    deliv_name01 text,
668    deliv_name02 text,
669    deliv_kana01 text,
670    deliv_kana02 text,
671    deliv_tel01 text,
672    deliv_tel02 text,
673    deliv_tel03 text,
674    deliv_fax01 text,
675    deliv_fax02 text,
676    deliv_fax03 text,
677    deliv_zip01 text,
678    deliv_zip02 text,
679    deliv_pref smallint,
680    deliv_addr01 text,
681    deliv_addr02 text,
682    subtotal numeric,
683    discount numeric,
684    deliv_fee numeric,
685    charge numeric,
686    use_point numeric,
687    add_point numeric,
688    birth_point numeric DEFAULT 0,
689    tax numeric,
690    total numeric,
691    payment_total numeric,
692    payment_id int,
693    payment_method text,
694    deliv_id int,
695    deliv_time_id int,
696    deliv_time text,
697    deliv_no text,
698    note text,
699    mail_flag smallint,
700    status smallint,
701    deliv_check smallint,
702    point_check smallint,
703    create_date datetime NOT NULL,
704    update_date datetime,
705    device_type_id int,
706    del_flg smallint NOT NULL DEFAULT 0,
707    deliv_date text,
708    order_id int,
709    memo01 text,
710    memo02 text,
711    memo03 text,
712    memo04 text,
713    memo05 text,
714    memo06 text,
715    memo07 text,
716    memo08 text,
717    memo09 text,
718    memo10 text,
719    session text
720) TYPE=InnoDB;
721
722CREATE TABLE dtb_other_deliv (
723    other_deliv_id int  NOT NULL,
724    customer_id int NOT NULL,
725    name01 text,
726    name02 text,
727    kana01 text,
728    kana02 text,
729    zip01 text,
730    zip02 text,
731    pref smallint,
732    addr01 text,
733    addr02 text,
734    tel01 text,
735    tel02 text,
736    tel03 text,
737    PRIMARY KEY (other_deliv_id)
738) TYPE=InnoDB;
739
740CREATE TABLE dtb_order_detail (
741    order_id int NOT NULL,
742    product_id int NOT NULL,
743    product_class_id int NOT NULL,
744    product_name text NOT NULL,
745    product_code text,
746    classcategory_name1 text,
747    classcategory_name2 text,
748    price numeric,
749    quantity numeric,
750    point_rate numeric
751) TYPE=InnoDB;
752
753CREATE TABLE mtb_pref (
754    pref_id smallint NOT NULL,
755    pref_name text,
756    rank smallint NOT NULL DEFAULT 0,
757    PRIMARY KEY (pref_id)
758) TYPE=InnoDB;
759
760CREATE TABLE dtb_member (
761    member_id int  NOT NULL,
762    name text,
763    department text,
764    login_id text NOT NULL,
765    password text NOT NULL,
766    authority smallint NOT NULL,
767    rank int NOT NULL DEFAULT 0,
768    work smallint NOT NULL DEFAULT 1,
769    del_flg smallint NOT NULL DEFAULT 0,
770    creator_id int NOT NULL,
771    update_date datetime,
772    create_date datetime NOT NULL,
773    login_date datetime,
774    PRIMARY KEY (member_id)
775) TYPE=InnoDB;
776
777CREATE TABLE dtb_bat_relate_products (
778    product_id int,
779    relate_product_id int,
780    customer_id int,
781    create_date datetime
782) TYPE=InnoDB;
783
784CREATE TABLE dtb_pagelayout (
785    device_type_id int NOT NULL,
786    page_id int  NOT NULL,
787    page_name text,
788    url text NOT NULL,
789    php_dir text,
790    tpl_dir text,
791    filename text,
792    header_chk smallint DEFAULT 1,
793    footer_chk smallint DEFAULT 1,
794    edit_flg smallint DEFAULT 1,
795    author text,
796    description text,
797    keyword text,
798    update_url text,
799    create_date datetime NOT NULL,
800    update_date datetime NOT NULL,
801    PRIMARY KEY (device_type_id, page_id)
802) TYPE=InnoDB;
803
804CREATE TABLE dtb_bloc (
805    device_type_id int NOT NULL,
806    bloc_id int  NOT NULL,
807    bloc_name text,
808    tpl_path text,
809    filename varchar(50) NOT NULL,
810    create_date datetime NOT NULL,
811    update_date datetime NOT NULL,
812    php_path text,
813    del_flg smallint NOT NULL DEFAULT 0,
814    PRIMARY KEY (device_type_id, bloc_id),
815    UNIQUE (device_type_id, filename)
816) TYPE=InnoDB;
817
818CREATE TABLE dtb_blocposition (
819    device_type_id int NOT NULL,
820    page_id int NOT NULL,
821    target_id int NOT NULL,
822    bloc_id int NOT NULL,
823    bloc_row int,
824    anywhere smallint DEFAULT 0 NOT NULL,
825    PRIMARY KEY (device_type_id, page_id, target_id, bloc_id)
826) TYPE=InnoDB;
827
828CREATE TABLE dtb_csv (
829    no int,
830    csv_id int NOT NULL,
831    col text,
832    disp_name text,
833    rank int,
834    status smallint NOT NULL DEFAULT 1,
835    create_date datetime NOT NULL,
836    update_date datetime NOT NULL,
837    mb_convert_kana_option text,
838    PRIMARY KEY (no)
839) TYPE=InnoDB;
840
841CREATE TABLE dtb_csv_sql (
842    sql_id int,
843    sql_name text NOT NULL,
844    csv_sql text,
845    update_date datetime NOT NULL,
846    create_date datetime NOT NULL,
847    PRIMARY KEY (sql_id)
848) TYPE=InnoDB;
849
850CREATE TABLE dtb_templates (
851    template_code varchar(50) NOT NULL,
852    template_name text,
853    create_date datetime NOT NULL,
854    update_date datetime NOT NULL,
855    PRIMARY KEY (template_code)
856) TYPE=InnoDB;
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) TYPE=InnoDB;
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 datetime NOT NULL,
872    update_date datetime NOT NULL,
873    del_flg smallint NOT NULL DEFAULT 0,
874    PRIMARY KEY (maker_id)
875) TYPE=InnoDB;
876
877CREATE TABLE dtb_maker_count (
878    maker_id int NOT NULL,
879    product_count int NOT NULL,
880    create_date datetime NOT NULL
881) TYPE=InnoDB;
882
883
884CREATE TABLE mtb_permission (
885    id text,
886    name text,
887    rank smallint NOT NULL DEFAULT 0,
888    PRIMARY KEY (id(32))
889) TYPE=InnoDB;
890
891CREATE TABLE mtb_disable_logout (
892    id smallint,
893    name text,
894    rank smallint NOT NULL DEFAULT 0,
895    PRIMARY KEY (id)
896) TYPE=InnoDB;
897
898CREATE TABLE mtb_authority (
899    id smallint,
900    name text,
901    rank smallint NOT NULL DEFAULT 0,
902    PRIMARY KEY (id)
903) TYPE=InnoDB;
904
905CREATE TABLE mtb_work (
906    id smallint,
907    name text,
908    rank smallint NOT NULL DEFAULT 0,
909    PRIMARY KEY (id)
910) TYPE=InnoDB;
911
912CREATE TABLE mtb_disp (
913    id smallint,
914    name text,
915    rank smallint NOT NULL DEFAULT 0,
916    PRIMARY KEY (id)
917) TYPE=InnoDB;
918
919CREATE TABLE mtb_class (
920    id smallint,
921    name text,
922    rank smallint NOT NULL DEFAULT 0,
923    PRIMARY KEY (id)
924) TYPE=InnoDB;
925
926CREATE TABLE mtb_status (
927    id smallint,
928    name text,
929    rank smallint NOT NULL DEFAULT 0,
930    PRIMARY KEY (id)
931) TYPE=InnoDB;
932
933CREATE TABLE mtb_status_image (
934    id smallint,
935    name text,
936    rank smallint NOT NULL DEFAULT 0,
937    PRIMARY KEY (id)
938) TYPE=InnoDB;
939
940CREATE TABLE mtb_allowed_tag (
941    id smallint,
942    name text,
943    rank smallint NOT NULL DEFAULT 0,
944    PRIMARY KEY (id)
945) TYPE=InnoDB;
946
947CREATE TABLE mtb_page_max (
948    id smallint,
949    name text,
950    rank smallint NOT NULL DEFAULT 0,
951    PRIMARY KEY (id)
952) TYPE=InnoDB;
953
954CREATE TABLE mtb_magazine_type (
955    id smallint,
956    name text,
957    rank smallint NOT NULL DEFAULT 0,
958    PRIMARY KEY (id)
959) TYPE=InnoDB;
960
961CREATE TABLE mtb_mail_magazine_type (
962    id smallint,
963    name text,
964    rank smallint NOT NULL DEFAULT 0,
965    PRIMARY KEY (id)
966) TYPE=InnoDB;
967
968CREATE TABLE mtb_recommend (
969    id smallint,
970    name text,
971    rank smallint NOT NULL DEFAULT 0,
972    PRIMARY KEY (id)
973) TYPE=InnoDB;
974
975CREATE TABLE mtb_taxrule (
976    id smallint,
977    name text,
978    rank smallint NOT NULL DEFAULT 0,
979    PRIMARY KEY (id)
980) TYPE=InnoDB;
981
982CREATE TABLE mtb_mail_template (
983    id smallint,
984    name text,
985    rank smallint NOT NULL DEFAULT 0,
986    PRIMARY KEY (id)
987) TYPE=InnoDB;
988
989CREATE TABLE mtb_mail_tpl_path (
990    id smallint,
991    name text,
992    rank smallint NOT NULL DEFAULT 0,
993    PRIMARY KEY (id)
994) TYPE=InnoDB;
995
996CREATE TABLE mtb_job (
997    id smallint,
998    name text,
999    rank smallint NOT NULL DEFAULT 0,
1000    PRIMARY KEY (id)
1001) TYPE=InnoDB;
1002
1003CREATE TABLE mtb_reminder (
1004    id smallint,
1005    name text,
1006    rank smallint NOT NULL DEFAULT 0,
1007    PRIMARY KEY (id)
1008) TYPE=InnoDB;
1009
1010CREATE TABLE mtb_sex (
1011    id smallint,
1012    name text,
1013    rank smallint NOT NULL DEFAULT 0,
1014    PRIMARY KEY (id)
1015) TYPE=InnoDB;
1016
1017CREATE TABLE mtb_page_rows (
1018    id smallint,
1019    name text,
1020    rank smallint NOT NULL DEFAULT 0,
1021    PRIMARY KEY (id)
1022) TYPE=InnoDB;
1023
1024CREATE TABLE mtb_mail_type (
1025    id smallint,
1026    name text,
1027    rank smallint NOT NULL DEFAULT 0,
1028    PRIMARY KEY (id)
1029) TYPE=InnoDB;
1030
1031CREATE TABLE mtb_order_status (
1032    id smallint,
1033    name text,
1034    rank smallint NOT NULL DEFAULT 0,
1035    PRIMARY KEY (id)
1036) TYPE=InnoDB;
1037
1038CREATE TABLE mtb_product_status_color (
1039    id smallint,
1040    name text,
1041    rank smallint NOT NULL DEFAULT 0,
1042    PRIMARY KEY (id)
1043) TYPE=InnoDB;
1044
1045CREATE TABLE mtb_order_status_color (
1046    id smallint,
1047    name text,
1048    rank smallint NOT NULL DEFAULT 0,
1049    PRIMARY KEY (id)
1050) TYPE=InnoDB;
1051
1052CREATE TABLE mtb_wday (
1053    id smallint,
1054    name text,
1055    rank smallint NOT NULL DEFAULT 0,
1056    PRIMARY KEY (id)
1057) TYPE=InnoDB;
1058
1059CREATE TABLE mtb_delivery_date (
1060    id smallint,
1061    name text,
1062    rank smallint NOT NULL DEFAULT 0,
1063    PRIMARY KEY (id)
1064) TYPE=InnoDB;
1065
1066CREATE TABLE mtb_product_list_max (
1067    id smallint,
1068    name text,
1069    rank smallint NOT NULL DEFAULT 0,
1070    PRIMARY KEY (id)
1071) TYPE=InnoDB;
1072
1073CREATE TABLE mtb_convenience (
1074    id smallint,
1075    name text,
1076    rank smallint NOT NULL DEFAULT 0,
1077    PRIMARY KEY (id)
1078) TYPE=InnoDB;
1079
1080CREATE TABLE mtb_conveni_message (
1081    id smallint,
1082    name text,
1083    rank smallint NOT NULL DEFAULT 0,
1084    PRIMARY KEY (id)
1085) TYPE=InnoDB;
1086
1087CREATE TABLE mtb_db (
1088    id smallint,
1089    name text,
1090    rank smallint NOT NULL DEFAULT 0,
1091    PRIMARY KEY (id)
1092) TYPE=InnoDB;
1093
1094CREATE TABLE mtb_target (
1095    id smallint,
1096    name text,
1097    rank smallint NOT NULL DEFAULT 0,
1098    PRIMARY KEY (id)
1099) TYPE=InnoDB;
1100
1101CREATE TABLE mtb_review_deny_url (
1102    id smallint,
1103    name text,
1104    rank smallint NOT NULL DEFAULT 0,
1105    PRIMARY KEY (id)
1106) TYPE=InnoDB;
1107
1108CREATE TABLE mtb_track_back_status (
1109    id smallint,
1110    name text,
1111    rank smallint NOT NULL DEFAULT 0,
1112    PRIMARY KEY (id)
1113) TYPE=InnoDB;
1114
1115CREATE TABLE mtb_site_control_track_back (
1116    id smallint,
1117    name text,
1118    rank smallint NOT NULL DEFAULT 0,
1119    PRIMARY KEY (id)
1120) TYPE=InnoDB;
1121
1122CREATE TABLE mtb_site_control_affiliate (
1123    id smallint,
1124    name text,
1125    rank smallint NOT NULL DEFAULT 0,
1126    PRIMARY KEY (id)
1127) TYPE=InnoDB;
1128
1129CREATE TABLE mtb_mobile_domain (
1130    id smallint,
1131    name text,
1132    rank smallint NOT NULL DEFAULT 0,
1133    PRIMARY KEY (id)
1134) TYPE=InnoDB;
1135
1136CREATE TABLE mtb_ownersstore_err (
1137    id smallint,
1138    name text,
1139    rank smallint NOT NULL DEFAULT 0,
1140    PRIMARY KEY (id)
1141) TYPE=InnoDB;
1142
1143CREATE TABLE mtb_ownersstore_ips (
1144    id smallint,
1145    name text,
1146    rank smallint NOT NULL DEFAULT 0,
1147    PRIMARY KEY (id)
1148) TYPE=InnoDB;
1149
1150CREATE TABLE mtb_constants (
1151    id text,
1152    name text,
1153    rank smallint NOT NULL DEFAULT 0,
1154    remarks text,
1155    PRIMARY KEY (id(64))
1156) TYPE=InnoDB;
1157
1158CREATE TABLE mtb_product_type (
1159    id smallint,
1160    name text,
1161    rank smallint NOT NULL,
1162    PRIMARY KEY (id)
1163) TYPE=InnoDB;
1164
1165CREATE TABLE mtb_device_type (
1166    id smallint,
1167    name text,
1168    rank smallint NOT NULL,
1169    PRIMARY KEY (id)
1170) TYPE=InnoDB;
1171
1172CREATE TABLE dtb_mobile_ext_session_id (
1173    session_id text NOT NULL,
1174    param_key text,
1175    param_value text,
1176    url text,
1177    create_date timestamp NOT NULL DEFAULT now()
1178);
1179
1180CREATE TABLE dtb_mobile_kara_mail (
1181    kara_mail_id serial PRIMARY KEY,
1182    session_id text NOT NULL,
1183    token text NOT NULL,
1184    next_url text NOT NULL,
1185    create_date timestamp NOT NULL DEFAULT now(),
1186    email text,
1187    receive_date timestamp
1188);
1189
1190CREATE TABLE dtb_module (
1191    module_id int NOT NULL UNIQUE,
1192    module_code text NOT NULL,
1193    module_name text NOT NULL,
1194    sub_data text,
1195    auto_update_flg smallint NOT NULL DEFAULT 0,
1196    del_flg smallint NOT NULL DEFAULT 0,
1197    create_date datetime NOT NULL,
1198    update_date datetime NOT NULL
1199) TYPE=InnoDB;
1200
1201CREATE TABLE dtb_session (
1202    sess_id varchar(50) NOT NULL,
1203    sess_data text,
1204    create_date datetime NOT NULL,
1205    update_date datetime NOT NULL,
1206    PRIMARY KEY (sess_id)
1207) TYPE=InnoDB;
1208
1209CREATE TABLE dtb_site_control (
1210    control_id int NOT NULL,
1211    control_title varchar(255),
1212    control_text text,
1213    control_flg smallint NOT NULL DEFAULT 2,
1214    del_flg smallint NOT NULL DEFAULT 0,
1215    memo text,
1216    create_date datetime NOT NULL,
1217    update_date datetime NOT NULL,
1218    PRIMARY KEY (control_id)
1219) TYPE=InnoDB;
1220
1221CREATE TABLE dtb_trackback (
1222    trackback_id int  NOT NULL,
1223    product_id int NOT NULL,
1224    blog_name varchar(255) NOT NULL,
1225    title varchar(255) NOT NULL,
1226    excerpt text NOT NULL,
1227    url text NOT NULL,
1228    status smallint NOT NULL DEFAULT 2,
1229    del_flg smallint NOT NULL DEFAULT 0,
1230    create_date datetime NOT NULL,
1231    update_date datetime NOT NULL,
1232    PRIMARY KEY (trackback_id)
1233) TYPE=InnoDB;
1234
1235CREATE TABLE dtb_bkup (
1236    bkup_name varchar(50),
1237    bkup_memo text,
1238    create_date datetime,
1239    PRIMARY KEY (bkup_name)
1240) TYPE=InnoDB;
1241
1242CREATE TABLE dtb_plugin (
1243    plugin_id int NOT NULL,
1244    plugin_name varchar(255) NOT NULL,
1245    enable smallint NOT NULL DEFAULT 0,
1246    del_flg smallint NOT NULL DEFAULT 0,
1247    class_name varchar(255) NOT NULL,
1248    create_date datetime NOT NULL,
1249    update_date datetime NOT NULL,
1250    PRIMARY KEY (plugin_id)
1251) TYPE=InnoDB;
1252
1253CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id(64));
1254CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id);
1255CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
1256CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
1257CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key(64));
1258CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value(64));
1259CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url(64));
1260CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date);
1261CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token(64));
1262CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date);
1263CREATE INDEX dtb_mobile_kara_mail_receive_date_key ON dtb_mobile_kara_mail (receive_date);
1264
1265CREATE TABLE dtb_index_list (
1266    table_name varchar(30) NOT NULL DEFAULT '',
1267    column_name varchar(30) NOT NULL DEFAULT '',
1268    recommend_flg smallint NOT NULL DEFAULT 0,
1269    recommend_comment text,
1270    PRIMARY KEY (table_name, column_name)
1271) TYPE=InnoDB;
Note: See TracBrowser for help on using the repository browser.