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

Revision 18818, 28.9 KB checked in by Seasoft, 12 years ago (diff)

#781(規格のデータベースを木構造に)

  • r18815 で発生していた商品を新規登録できない不具合を改修。
  • 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    down smallint NOT NULL DEFAULT 0,
310    down_filename text,
311    down_realfilename text,
312    PRIMARY KEY (product_id)
313);
314
315CREATE TABLE dtb_products_class (
316    product_class_id int NOT NULL,
317    product_id int NOT NULL,
318    class_combination_id int,
319    product_code text,
320    stock numeric,
321    stock_unlimited smallint NOT NULL DEFAULT 0,
322    sale_limit numeric,
323    price01 numeric,
324    price02 numeric,
325    deliv_fee numeric,
326    point_rate numeric,
327    status smallint,
328    creator_id int NOT NULL,
329    create_date timestamp NOT NULL DEFAULT now(),
330    update_date timestamp,
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    PRIMARY KEY (order_id)
661);
662
663CREATE TABLE dtb_order_temp (
664    order_temp_id text NOT NULL,
665    customer_id int NOT NULL,
666    message text,
667    order_name01 text,
668    order_name02 text,
669    order_kana01 text,
670    order_kana02 text,
671    order_email text,
672    order_tel01 text,
673    order_tel02 text,
674    order_tel03 text,
675    order_fax01 text,
676    order_fax02 text,
677    order_fax03 text,
678    order_zip01 text,
679    order_zip02 text,
680    order_pref smallint,
681    order_addr01 text,
682    order_addr02 text,
683    order_sex smallint,
684    order_birth timestamp,
685    order_job int,
686    deliv_name01 text,
687    deliv_name02 text,
688    deliv_kana01 text,
689    deliv_kana02 text,
690    deliv_tel01 text,
691    deliv_tel02 text,
692    deliv_tel03 text,
693    deliv_fax01 text,
694    deliv_fax02 text,
695    deliv_fax03 text,
696    deliv_zip01 text,
697    deliv_zip02 text,
698    deliv_pref smallint,
699    deliv_addr01 text,
700    deliv_addr02 text,
701    subtotal numeric,
702    discount numeric,
703    deliv_fee numeric,
704    charge numeric,
705    use_point numeric,
706    add_point numeric,
707    birth_point numeric DEFAULT 0,
708    tax numeric,
709    total numeric,
710    payment_total numeric,
711    payment_id int,
712    payment_method text,
713    deliv_id int,
714    deliv_time_id int,
715    deliv_time text,
716    deliv_no text,
717    note text,
718    mail_flag smallint,
719    status smallint,
720    deliv_check smallint,
721    point_check smallint,
722    loan_result text,
723    credit_result text,
724    credit_msg text,
725    create_date timestamp NOT NULL DEFAULT now(),
726    update_date timestamp,
727    del_flg smallint NOT NULL DEFAULT 0,
728    deliv_date text,
729    conveni_data text,
730    cell01 text,
731    cell02 text,
732    cell03 text,
733    order_id int,
734    memo01 text,
735    memo02 text,
736    memo03 text,
737    memo04 text,
738    memo05 text,
739    memo06 text,
740    memo07 text,
741    memo08 text,
742    memo09 text,
743    memo10 text,
744    session text
745);
746
747CREATE TABLE dtb_other_deliv (
748    other_deliv_id int NOT NULL,
749    customer_id int NOT NULL,
750    name01 text,
751    name02 text,
752    kana01 text,
753    kana02 text,
754    zip01 text,
755    zip02 text,
756    pref smallint,
757    addr01 text,
758    addr02 text,
759    tel01 text,
760    tel02 text,
761    tel03 text,
762    PRIMARY KEY (other_deliv_id)
763);
764
765CREATE TABLE dtb_order_detail (
766    order_id int NOT NULL,
767    product_id int NOT NULL,
768    classcategory_id1 int NOT NULL,
769    classcategory_id2 int NOT NULL,
770    product_name text NOT NULL,
771    product_code text,
772    classcategory_name1 text,
773    classcategory_name2 text,
774    price numeric,
775    quantity numeric,
776    point_rate numeric
777);
778
779CREATE TABLE mtb_pref (
780    pref_id smallint NOT NULL,
781    pref_name text,
782    rank smallint NOT NULL DEFAULT 0,
783    PRIMARY KEY (pref_id)
784);
785
786CREATE TABLE dtb_member (
787    member_id int NOT NULL,
788    name text,
789    department text,
790    login_id text NOT NULL,
791    password text NOT NULL,
792    authority smallint NOT NULL,
793    rank int NOT NULL DEFAULT 0,
794    work smallint NOT NULL DEFAULT 1,
795    del_flg smallint NOT NULL DEFAULT 0,
796    creator_id int NOT NULL,
797    update_date timestamp,
798    create_date timestamp NOT NULL DEFAULT now(),
799    login_date timestamp,
800    PRIMARY KEY (member_id)
801);
802
803CREATE TABLE dtb_bat_relate_products (
804    product_id int,
805    relate_product_id int,
806    customer_id int,
807    create_date timestamp DEFAULT now()
808);
809
810CREATE TABLE dtb_pagelayout (
811    page_id int NOT NULL,
812    page_name text,
813    url text NOT NULL,
814    php_dir text,
815    tpl_dir text,
816    filename text,
817    header_chk smallint DEFAULT 1,
818    footer_chk smallint DEFAULT 1,
819    edit_flg smallint DEFAULT 1,
820    author text,
821    description text,
822    keyword text,
823    update_url text,
824    create_date timestamp NOT NULL DEFAULT now(),
825    update_date timestamp NOT NULL DEFAULT now(),
826    PRIMARY KEY (page_id)
827);
828
829CREATE TABLE dtb_bloc (
830    bloc_id int NOT NULL,
831    bloc_name text,
832    tpl_path text,
833    filename text NOT NULL UNIQUE,
834    create_date timestamp NOT NULL DEFAULT now(),
835    update_date timestamp NOT NULL DEFAULT now(),
836    php_path text,
837    del_flg smallint NOT NULL DEFAULT 0,
838    PRIMARY KEY (bloc_id)
839);
840
841CREATE TABLE dtb_blocposition (
842    page_id int NOT NULL,
843    target_id int,
844    bloc_id int,
845    bloc_row int,
846    filename text,
847    anywhere smallint DEFAULT 0 NOT NULL
848);
849
850CREATE TABLE dtb_csv (
851    no int,
852    csv_id int NOT NULL,
853    col text,
854    disp_name text,
855    rank int,
856    status smallint NOT NULL DEFAULT 1,
857    create_date timestamp NOT NULL DEFAULT now(),
858    update_date timestamp NOT NULL DEFAULT now(),
859    mb_convert_kana_option text,
860    PRIMARY KEY (no)
861);
862
863CREATE TABLE dtb_csv_sql (
864    sql_id int,
865    sql_name text NOT NULL,
866    csv_sql text,
867    update_date timestamp NOT NULL DEFAULT now(),
868    create_date timestamp NOT NULL DEFAULT now(),
869    PRIMARY KEY (sql_id)
870);
871
872create table dtb_templates (
873    template_code text NOT NULL,
874    template_name text,
875    create_date timestamp NOT NULL DEFAULT now(),
876    update_date timestamp NOT NULL DEFAULT now(),
877    PRIMARY KEY (template_code)
878);
879
880create table dtb_table_comment (
881    id int,
882    table_name text,
883    column_name text,
884    description text,
885    PRIMARY KEY (id)
886);
887
888CREATE TABLE dtb_maker (
889    maker_id int NOT NULL,
890    name text NOT NULL,
891    rank int NOT NULL DEFAULT 0,
892    creator_id int NOT NULL,
893    create_date timestamp NOT NULL DEFAULT now(),
894    update_date timestamp NOT NULL,
895    del_flg smallint NOT NULL DEFAULT 0,
896    PRIMARY KEY (maker_id)
897);
898
899CREATE TABLE dtb_maker_count (
900    maker_id int NOT NULL,
901    product_count int NOT NULL,
902    create_date timestamp NOT NULL DEFAULT Now()
903);
904
905CREATE TABLE mtb_permission (
906    id text,
907    name text,
908    rank smallint NOT NULL DEFAULT 0,
909    PRIMARY KEY (id)
910);
911
912CREATE TABLE mtb_disable_logout (
913    id smallint,
914    name text,
915    rank smallint NOT NULL DEFAULT 0,
916    PRIMARY KEY (id)
917);
918
919CREATE TABLE mtb_authority (
920    id smallint,
921    name text,
922    rank smallint NOT NULL DEFAULT 0,
923    PRIMARY KEY (id)
924);
925
926CREATE TABLE mtb_work (
927    id smallint,
928    name text,
929    rank smallint NOT NULL DEFAULT 0,
930    PRIMARY KEY (id)
931);
932
933CREATE TABLE mtb_disp (
934    id smallint,
935    name text,
936    rank smallint NOT NULL DEFAULT 0,
937    PRIMARY KEY (id)
938);
939
940CREATE TABLE mtb_class (
941    id smallint,
942    name text,
943    rank smallint NOT NULL DEFAULT 0,
944    PRIMARY KEY (id)
945);
946
947CREATE TABLE mtb_status (
948    id smallint,
949    name text,
950    rank smallint NOT NULL DEFAULT 0,
951    PRIMARY KEY (id)
952);
953
954CREATE TABLE mtb_status_image (
955    id smallint,
956    name text,
957    rank smallint NOT NULL DEFAULT 0,
958    PRIMARY KEY (id)
959);
960
961CREATE TABLE mtb_allowed_tag (
962    id smallint,
963    name text,
964    rank smallint NOT NULL DEFAULT 0,
965    PRIMARY KEY (id)
966);
967
968CREATE TABLE mtb_page_max (
969    id smallint,
970    name text,
971    rank smallint NOT NULL DEFAULT 0,
972    PRIMARY KEY (id)
973);
974
975CREATE TABLE mtb_magazine_type (
976    id smallint,
977    name text,
978    rank smallint NOT NULL DEFAULT 0,
979    PRIMARY KEY (id)
980);
981
982CREATE TABLE mtb_mail_magazine_type (
983    id smallint,
984    name text,
985    rank smallint NOT NULL DEFAULT 0,
986    PRIMARY KEY (id)
987);
988
989CREATE TABLE mtb_recommend (
990    id smallint,
991    name text,
992    rank smallint NOT NULL DEFAULT 0,
993    PRIMARY KEY (id)
994);
995
996CREATE TABLE mtb_taxrule (
997    id smallint,
998    name text,
999    rank smallint NOT NULL DEFAULT 0,
1000    PRIMARY KEY (id)
1001);
1002
1003CREATE TABLE mtb_mail_template (
1004    id smallint,
1005    name text,
1006    rank smallint NOT NULL DEFAULT 0,
1007    PRIMARY KEY (id)
1008);
1009
1010CREATE TABLE mtb_mail_tpl_path (
1011    id smallint,
1012    name text,
1013    rank smallint NOT NULL DEFAULT 0,
1014    PRIMARY KEY (id)
1015);
1016
1017CREATE TABLE mtb_job (
1018    id smallint,
1019    name text,
1020    rank smallint NOT NULL DEFAULT 0,
1021    PRIMARY KEY (id)
1022);
1023
1024CREATE TABLE mtb_reminder (
1025    id smallint,
1026    name text,
1027    rank smallint NOT NULL DEFAULT 0,
1028    PRIMARY KEY (id)
1029);
1030
1031CREATE TABLE mtb_sex (
1032    id smallint,
1033    name text,
1034    rank smallint NOT NULL DEFAULT 0,
1035    PRIMARY KEY (id)
1036);
1037
1038CREATE TABLE mtb_page_rows (
1039    id smallint,
1040    name text,
1041    rank smallint NOT NULL DEFAULT 0,
1042    PRIMARY KEY (id)
1043);
1044
1045CREATE TABLE mtb_mail_type (
1046    id smallint,
1047    name text,
1048    rank smallint NOT NULL DEFAULT 0,
1049    PRIMARY KEY (id)
1050);
1051
1052CREATE TABLE mtb_order_status (
1053    id smallint,
1054    name text,
1055    rank smallint NOT NULL DEFAULT 0,
1056    PRIMARY KEY (id)
1057);
1058
1059CREATE TABLE mtb_product_status_color (
1060    id smallint,
1061    name text,
1062    rank smallint NOT NULL DEFAULT 0,
1063    PRIMARY KEY (id)
1064);
1065
1066CREATE TABLE mtb_order_status_color (
1067    id smallint,
1068    name text,
1069    rank smallint NOT NULL DEFAULT 0,
1070    PRIMARY KEY (id)
1071);
1072
1073CREATE TABLE mtb_wday (
1074    id smallint,
1075    name text,
1076    rank smallint NOT NULL DEFAULT 0,
1077    PRIMARY KEY (id)
1078);
1079
1080CREATE TABLE mtb_delivery_date (
1081    id smallint,
1082    name text,
1083    rank smallint NOT NULL DEFAULT 0,
1084    PRIMARY KEY (id)
1085);
1086
1087CREATE TABLE mtb_product_list_max (
1088    id smallint,
1089    name text,
1090    rank smallint NOT NULL DEFAULT 0,
1091    PRIMARY KEY (id)
1092);
1093
1094CREATE TABLE mtb_convenience (
1095    id smallint,
1096    name text,
1097    rank smallint NOT NULL DEFAULT 0,
1098    PRIMARY KEY (id)
1099);
1100
1101CREATE TABLE mtb_conveni_message (
1102    id smallint,
1103    name text,
1104    rank smallint NOT NULL DEFAULT 0,
1105    PRIMARY KEY (id)
1106);
1107
1108CREATE TABLE mtb_db (
1109    id smallint,
1110    name text,
1111    rank smallint NOT NULL DEFAULT 0,
1112    PRIMARY KEY (id)
1113);
1114
1115CREATE TABLE mtb_target (
1116    id smallint,
1117    name text,
1118    rank smallint NOT NULL DEFAULT 0,
1119    PRIMARY KEY (id)
1120);
1121
1122CREATE TABLE mtb_review_deny_url (
1123    id smallint,
1124    name text,
1125    rank smallint NOT NULL DEFAULT 0,
1126    PRIMARY KEY (id)
1127);
1128
1129CREATE TABLE mtb_track_back_status (
1130    id smallint,
1131    name text,
1132    rank smallint NOT NULL DEFAULT 0,
1133    PRIMARY KEY (id)
1134);
1135
1136CREATE TABLE mtb_site_control_track_back (
1137    id smallint,
1138    name text,
1139    rank smallint NOT NULL DEFAULT 0,
1140    PRIMARY KEY (id)
1141);
1142
1143CREATE TABLE mtb_site_control_affiliate (
1144    id smallint,
1145    name text,
1146    rank smallint NOT NULL DEFAULT 0,
1147    PRIMARY KEY (id)
1148);
1149
1150CREATE TABLE mtb_mobile_domain (
1151    id smallint,
1152    name text,
1153    rank smallint NOT NULL DEFAULT 0,
1154    PRIMARY KEY (id)
1155);
1156
1157CREATE TABLE mtb_ownersstore_err (
1158    id text,
1159    name text,
1160    rank smallint NOT NULL DEFAULT 0,
1161    PRIMARY KEY (id)
1162);
1163
1164CREATE TABLE mtb_ownersstore_ips (
1165    id text,
1166    name text,
1167    rank smallint NOT NULL DEFAULT 0,
1168    PRIMARY KEY (id)
1169);
1170
1171CREATE TABLE mtb_constants (
1172    id text,
1173    name text,
1174    rank smallint NOT NULL DEFAULT 0,
1175    remarks text,
1176    PRIMARY KEY (id)
1177);
1178
1179CREATE TABLE mtb_down (
1180    id int2,
1181    name text,
1182    rank int2 NOT NULL,
1183    PRIMARY KEY (id)
1184);
1185
1186CREATE TABLE dtb_mobile_ext_session_id (
1187    session_id text NOT NULL,
1188    param_key text,
1189    param_value text,
1190    url text,
1191    create_date timestamp NOT NULL DEFAULT now()
1192);
1193
1194CREATE TABLE dtb_mobile_kara_mail (
1195    kara_mail_id int PRIMARY KEY,
1196    session_id text NOT NULL,
1197    token text NOT NULL,
1198    next_url text NOT NULL,
1199    create_date timestamp NOT NULL DEFAULT now(),
1200    email text,
1201    receive_date timestamp
1202);
1203
1204CREATE TABLE dtb_session (
1205    sess_id text NOT NULL,
1206    sess_data text,
1207    create_date timestamp NOT NULL,
1208    update_date timestamp NOT NULL,
1209    PRIMARY KEY (sess_id)
1210);
1211
1212CREATE TABLE dtb_module (
1213    module_id int NOT NULL UNIQUE,
1214    module_code text NOT NULL,
1215    module_name text NOT NULL,
1216    sub_data text,
1217    auto_update_flg int2 NOT NULL DEFAULT 0,
1218    del_flg int2 NOT NULL DEFAULT 0,
1219    create_date timestamp NOT NULL DEFAULT NOW(),
1220    update_date timestamp NOT NULL
1221);
1222
1223CREATE TABLE dtb_site_control (
1224    control_id int primary key NOT NULL,
1225    control_title text ,
1226    control_text text ,
1227    control_flg int2 NOT NULL DEFAULT 2,
1228    del_flg int2 NOT NULL DEFAULT 0,
1229    memo text ,
1230    create_date timestamp NOT NULL DEFAULT now(),
1231    update_date timestamp NOT NULL DEFAULT now()
1232);
1233
1234CREATE TABLE dtb_trackback (
1235    trackback_id int primary key NOT NULL,
1236    product_id int NOT NULL,
1237    blog_name varchar(255) NOT NULL DEFAULT '',
1238    title varchar(255) NOT NULL DEFAULT '',
1239    excerpt text NOT NULL DEFAULT '',
1240    url text NOT NULL DEFAULT '',
1241    status int2 NOT NULL DEFAULT 2,
1242    del_flg int2 NOT NULL DEFAULT 0,
1243    create_date timestamp NOT NULL,
1244    update_date timestamp NOT NULL
1245);
1246
1247CREATE TABLE dtb_bkup (
1248    bkup_name   varchar(50),
1249    bkup_memo   text,
1250    create_date timestamp,
1251    PRIMARY KEY (bkup_name)
1252);
1253
1254CREATE INDEX dtb_customer_mobile_phone_id_key ON dtb_customer (mobile_phone_id);
1255CREATE INDEX dtb_products_class_product_id_key ON dtb_products_class(product_id);
1256CREATE INDEX dtb_order_detail_product_id_key ON dtb_order_detail(product_id);
1257CREATE INDEX dtb_send_customer_customer_id_key ON dtb_send_customer(customer_id);
1258
1259CREATE INDEX dtb_mobile_ext_session_id_param_key_key ON dtb_mobile_ext_session_id (param_key);
1260CREATE INDEX dtb_mobile_ext_session_id_param_value_key ON dtb_mobile_ext_session_id (param_value);
1261CREATE INDEX dtb_mobile_ext_session_id_url_key ON dtb_mobile_ext_session_id (url);
1262CREATE INDEX dtb_mobile_ext_session_id_create_date_key ON dtb_mobile_ext_session_id (create_date);
1263
1264CREATE INDEX dtb_mobile_kara_mail_token_key ON dtb_mobile_kara_mail (token);
1265CREATE INDEX dtb_mobile_kara_mail_create_date_key ON dtb_mobile_kara_mail (create_date);
1266CREATE 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.