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

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