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

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