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

Revision 18791, 28.4 KB checked in by nanasess, 11 years ago (diff)

DB_TYPE で条件分岐している箇所の抽象化(#801)

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