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

Revision 18777, 29.1 KB checked in by eccuore, 10 years ago (diff)

#792(ダウンロード販売機能) 機能追加

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