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

Revision 18916, 28.8 KB checked in by AMUAMU, 12 years ago (diff)

商品種別のフィールドのデフォルト値が無い事で他に影響があるため、とりあえずDEFAULTを設定product_type_id

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