source: branches/comu-ver2/html/install/sql/create_table_pgsql.sql @ 18190

Revision 18190, 28.3 KB checked in by miningbrownie, 15 years ago (diff)

ブロックをすべてのページにまたがって表示させるようにしました。(nanasessさまからのご提案です。) チケット:#518

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