source: branches/camp/camp-2_5-E/html/install/sql/create_table_mysql.sql @ 19215

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