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

Revision 18023, 28.3 KB checked in by Seasoft, 15 years ago (diff)

#472「管理機能の配送業者の追加でエラー」を修正。

  • 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);
933
934CREATE TABLE dtb_csv (
935    no serial,
936    csv_id int4 NOT NULL,
937    col text,
938    disp_name text,
939    rank int4,
940    status int2 NOT NULL DEFAULT 1,
941    create_date timestamp NOT NULL DEFAULT now(),
942    update_date timestamp NOT NULL DEFAULT now(),
943    PRIMARY KEY (no)
944);
945
946CREATE TABLE dtb_csv_sql (
947    sql_id serial,
948    sql_name text NOT NULL,
949    csv_sql text,
950    update_date timestamp NOT NULL DEFAULT now(),
951    create_date timestamp NOT NULL DEFAULT now(),
952    PRIMARY KEY (sql_id)
953);
954
955CREATE TABLE dtb_user_regist (
956    user_id serial NOT NULL,
957    org_name text,
958    post_name text,
959    name01 text,
960    name02 text,
961    kana01 text,
962    kana02 text,
963    email text NOT NULL,
964    url text,
965    note text,
966    secret_key text NOT NULL UNIQUE,
967    status int2 NOT NULL,
968    del_flg int2 DEFAULT 0,
969    create_date timestamp NOT NULL,
970    update_date timestamp NOT NULL DEFAULT now(),
971    PRIMARY KEY (user_id)
972);
973
974create table dtb_templates (
975    template_code        text        NOT NULL,
976    template_name        text            ,
977    create_date        timestamp        NOT NULL    default now(),
978    update_date        timestamp        NOT NULL    default now(),
979    PRIMARY KEY (template_code)
980);
981
982create table dtb_table_comment (
983    id    serial,
984    table_name    text,
985    column_name    text,
986    description    text,
987    PRIMARY KEY (id)
988);
989
990CREATE TABLE dtb_maker (
991    maker_id serial NOT NULL,
992    name text NOT NULL,
993    rank int4 NOT NULL DEFAULT 0,
994    creator_id int4 NOT NULL,
995    create_date timestamp NOT NULL DEFAULT now(),
996    update_date timestamp NOT NULL,
997    del_flg int2 NOT NULL DEFAULT 0,
998    PRIMARY KEY (maker_id)
999);
1000
1001CREATE TABLE dtb_maker_count (
1002    maker_id int4 NOT NULL,
1003    product_count int4 NOT NULL,
1004    create_date timestamp NOT NULL DEFAULT Now()
1005);
1006
1007CREATE TABLE mtb_permission (
1008    id text,
1009    name text,
1010    rank int2 NOT NULL DEFAULT 0,
1011    PRIMARY KEY (id)
1012);
1013
1014CREATE TABLE mtb_disable_logout (
1015    id int2,
1016    name text,
1017    rank int2 NOT NULL DEFAULT 0,
1018    PRIMARY KEY (id)
1019);
1020
1021CREATE TABLE mtb_authority (
1022    id int2,
1023    name text,
1024    rank int2 NOT NULL DEFAULT 0,
1025    PRIMARY KEY (id)
1026);
1027
1028CREATE TABLE mtb_work (
1029    id int2,
1030    name text,
1031    rank int2 NOT NULL DEFAULT 0,
1032    PRIMARY KEY (id)
1033);
1034
1035CREATE TABLE mtb_disp (
1036    id int2,
1037    name text,
1038    rank int2 NOT NULL DEFAULT 0,
1039    PRIMARY KEY (id)
1040);
1041
1042CREATE TABLE mtb_class (
1043    id int2,
1044    name text,
1045    rank int2 NOT NULL DEFAULT 0,
1046    PRIMARY KEY (id)
1047);
1048
1049CREATE TABLE mtb_srank (
1050    id int2,
1051    name text,
1052    rank int2 NOT NULL DEFAULT 0,
1053    PRIMARY KEY (id)
1054);
1055
1056CREATE TABLE mtb_status (
1057    id int2,
1058    name text,
1059    rank int2 NOT NULL DEFAULT 0,
1060    PRIMARY KEY (id)
1061);
1062
1063CREATE TABLE mtb_status_image (
1064    id int2,
1065    name text,
1066    rank int2 NOT NULL DEFAULT 0,
1067    PRIMARY KEY (id)
1068);
1069
1070CREATE TABLE mtb_allowed_tag (
1071    id int2,
1072    name text,
1073    rank int2 NOT NULL DEFAULT 0,
1074    PRIMARY KEY (id)
1075);
1076
1077CREATE TABLE mtb_page_max (
1078    id int2,
1079    name text,
1080    rank int2 NOT NULL DEFAULT 0,
1081    PRIMARY KEY (id)
1082);
1083
1084CREATE TABLE mtb_magazine_type (
1085    id int2,
1086    name text,
1087    rank int2 NOT NULL DEFAULT 0,
1088    PRIMARY KEY (id)
1089);
1090
1091CREATE TABLE mtb_mail_magazine_type (
1092    id int2,
1093    name text,
1094    rank int2 NOT NULL DEFAULT 0,
1095    PRIMARY KEY (id)
1096);
1097
1098CREATE TABLE mtb_recommend (
1099    id int2,
1100    name text,
1101    rank int2 NOT NULL DEFAULT 0,
1102    PRIMARY KEY (id)
1103);
1104
1105CREATE TABLE mtb_taxrule (
1106    id int2,
1107    name text,
1108    rank int2 NOT NULL DEFAULT 0,
1109    PRIMARY KEY (id)
1110);
1111
1112CREATE TABLE mtb_mail_template (
1113    id int2,
1114    name text,
1115    rank int2 NOT NULL DEFAULT 0,
1116    PRIMARY KEY (id)
1117);
1118
1119CREATE TABLE mtb_mail_tpl_path (
1120    id int2,
1121    name text,
1122    rank int2 NOT NULL DEFAULT 0,
1123    PRIMARY KEY (id)
1124);
1125
1126CREATE TABLE mtb_job (
1127    id int2,
1128    name text,
1129    rank int2 NOT NULL DEFAULT 0,
1130    PRIMARY KEY (id)
1131);
1132
1133CREATE TABLE mtb_reminder (
1134    id int2,
1135    name text,
1136    rank int2 NOT NULL DEFAULT 0,
1137    PRIMARY KEY (id)
1138);
1139
1140CREATE TABLE mtb_sex (
1141    id int2,
1142    name text,
1143    rank int2 NOT NULL DEFAULT 0,
1144    PRIMARY KEY (id)
1145);
1146
1147CREATE TABLE mtb_page_rows (
1148    id int2,
1149    name text,
1150    rank int2 NOT NULL DEFAULT 0,
1151    PRIMARY KEY (id)
1152);
1153
1154CREATE TABLE mtb_mail_type (
1155    id int2,
1156    name text,
1157    rank int2 NOT NULL DEFAULT 0,
1158    PRIMARY KEY (id)
1159);
1160
1161CREATE TABLE mtb_order_status (
1162    id int2,
1163    name text,
1164    rank int2 NOT NULL DEFAULT 0,
1165    PRIMARY KEY (id)
1166);
1167
1168CREATE TABLE mtb_product_status_color (
1169    id int2,
1170    name text,
1171    rank int2 NOT NULL DEFAULT 0,
1172    PRIMARY KEY (id)
1173);
1174
1175CREATE TABLE mtb_order_status_color (
1176    id int2,
1177    name text,
1178    rank int2 NOT NULL DEFAULT 0,
1179    PRIMARY KEY (id)
1180);
1181
1182CREATE TABLE mtb_wday (
1183    id int2,
1184    name text,
1185    rank int2 NOT NULL DEFAULT 0,
1186    PRIMARY KEY (id)
1187);
1188
1189CREATE TABLE mtb_delivery_date (
1190    id int2,
1191    name text,
1192    rank int2 NOT NULL DEFAULT 0,
1193    PRIMARY KEY (id)
1194);
1195
1196CREATE TABLE mtb_product_list_max (
1197    id int2,
1198    name text,
1199    rank int2 NOT NULL DEFAULT 0,
1200    PRIMARY KEY (id)
1201);
1202
1203CREATE TABLE mtb_convenience (
1204    id int2,
1205    name text,
1206    rank int2 NOT NULL DEFAULT 0,
1207    PRIMARY KEY (id)
1208);
1209
1210CREATE TABLE mtb_conveni_message (
1211    id int2,
1212    name text,
1213    rank int2 NOT NULL DEFAULT 0,
1214    PRIMARY KEY (id)
1215);
1216
1217CREATE TABLE mtb_db (
1218    id int2,
1219    name text,
1220    rank int2 NOT NULL DEFAULT 0,
1221    PRIMARY KEY (id)
1222);
1223
1224CREATE TABLE mtb_target (
1225    id int2,
1226    name text,
1227    rank int2 NOT NULL DEFAULT 0,
1228    PRIMARY KEY (id)
1229);
1230
1231CREATE TABLE mtb_review_deny_url (
1232    id int2,
1233    name text,
1234    rank int2 NOT NULL DEFAULT 0,
1235    PRIMARY KEY (id)
1236);
1237
1238CREATE TABLE mtb_track_back_status (
1239    id int2,
1240    name text,
1241    rank int2 NOT NULL DEFAULT 0,
1242    PRIMARY KEY (id)
1243);
1244
1245CREATE TABLE mtb_site_control_track_back (
1246    id int2,
1247    name text,
1248    rank int2 NOT NULL DEFAULT 0,
1249    PRIMARY KEY (id)
1250);
1251
1252CREATE TABLE mtb_site_control_affiliate (
1253    id int2,
1254    name text,
1255    rank int2 NOT NULL DEFAULT 0,
1256    PRIMARY KEY (id)
1257);
1258
1259CREATE TABLE mtb_mobile_domain (
1260    id int2,
1261    name text,
1262    rank int2 NOT NULL DEFAULT 0,
1263    PRIMARY KEY (id)
1264);
1265
1266CREATE TABLE mtb_ownersstore_err (
1267    id text,
1268    name text,
1269    rank int2 NOT NULL DEFAULT 0,
1270    PRIMARY KEY (id)
1271);
1272
1273CREATE TABLE mtb_ownersstore_ips (
1274    id text,
1275    name text,
1276    rank int2 NOT NULL DEFAULT 0,
1277    PRIMARY KEY (id)
1278);
1279
1280CREATE TABLE mtb_constants (
1281    id text,
1282    name text,
1283    rank int2 NOT NULL DEFAULT 0,
1284    remarks text,
1285    PRIMARY KEY (id)
1286);
Note: See TracBrowser for help on using the repository browser.