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

Revision 18825, 28.9 KB checked in by eccuore, 14 years ago (diff)

#792(ダウンロード販売機能) product_class_id対応(規格構成変更と並行作業中なので、作業途中の部分有)

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