Index: branches/version-2_5-dev/html/install/sql/create_view.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_view.sql	(revision 18815)
+++ branches/version-2_5-dev/html/install/sql/create_view.sql	(revision 18819)
@@ -53,7 +53,4 @@
         dtb_products.update_date,
         dtb_products.deliv_date_id,
-        dtb_products.down,
-        dtb_products.down_filename,
-        dtb_products.down_realfilename,
         T4.product_code_min,
         T4.product_code_max,
@@ -105,2 +102,23 @@
             ON T2.category_id = dtb_category.category_id
 ;
+CREATE VIEW vw_download_class as
+        SELECT
+            pc.product_id AS product_id,
+            pc.classcategory_id1 AS classcategory_id1,
+            pc.classcategory_id2 AS classcategory_id2,
+            pc.down_realfilename AS down_realfilename,
+            pc.down_filename AS down_filename,
+            o.order_id AS order_id,
+            o.customer_id AS customer_id,
+            o.payment_date AS payment_date,
+            o.status AS status
+        FROM
+            dtb_products_class pc,
+            dtb_order_detail od,
+            dtb_order o
+        WHERE
+            pc.product_id = od.product_id AND
+            pc.classcategory_id1 = od.classcategory_id1 AND
+            pc.classcategory_id2 = od.classcategory_id2 AND
+            od.order_id = o.order_id
+;
Index: branches/version-2_5-dev/html/install/sql/insert_data.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/insert_data.sql	(revision 18818)
+++ branches/version-2_5-dev/html/install/sql/insert_data.sql	(revision 18819)
@@ -395,14 +395,14 @@
 INSERT INTO dtb_products (product_id, name, maker_id, rank, status, comment1, comment2, comment3, comment4, comment5, comment6, note, file1, file2, file3, file4, file5, file6, main_list_comment, main_list_image, main_comment, main_image, main_large_image, sub_title1, sub_comment1, sub_image1, sub_large_image1, sub_title2, sub_comment2, sub_image2, sub_large_image2, sub_title3, sub_comment3, sub_image3, sub_large_image3, sub_title4, sub_comment4, sub_image4, sub_large_image4, sub_title5, sub_comment5, sub_image5, sub_large_image5, sub_title6, sub_comment6, sub_image6, sub_large_image6, del_flg, creator_id, create_date, update_date, deliv_date_id) VALUES (2, 'おなべ', NULL, 1, 1, NULL, NULL, '鍋,なべ,ナベ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '一人用からあります。', '08311311_44f661811fec0.jpg', 'たまには鍋でもどうでしょう。', '08311313_44f661dc649fb.jpg', '08311313_44f661e5698a6.jpg', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 3);
 
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(1, 1, 10, 'ice-01', NULL, 1, NULL, 150, 120, NULL, 10, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(2, 1, 11, 'ice-01', NULL, 1, NULL, 150, 120, NULL, 5, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(3, 1, 12, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(4, 1, 13, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(5, 1, 14, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(6, 1, 15, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(7, 1, 16, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(8, 1, 17, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(9, 1, 18, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
-INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg) VALUES(10, 2, NULL, 'nabe-01', 100, 0, 5, 1700, 1650, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(1, 1, 10, 'ice-01', NULL, 1, NULL, 150, 120, NULL, 10, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(2, 1, 11, 'ice-01', NULL, 1, NULL, 150, 120, NULL, 5, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(3, 1, 12, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(4, 1, 13, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(5, 1, 14, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(6, 1, 15, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(7, 1, 16, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(8, 1, 17, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(9, 1, 18, 'ice-01', NULL, 1, NULL, 150, 120, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
+INSERT INTO dtb_products_class (product_class_id, product_id, class_combination_id, product_code, stock, stock_unlimited, sale_limit, price01, price02, deliv_fee, point_rate, status, creator_id, create_date, update_date, del_flg, down, down_filename, down_realfilename) VALUES(10, 2, NULL, 'nabe-01', 100, 0, 5, 1700, 1650, NULL, NULL, NULL, 2, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 0, 1, NULL, NULL);
 
 INSERT INTO dtb_class_combination (class_combination_id, parent_class_combination_id, classcategory_id, level) VALUES(1, NULL, 3, 1);
Index: branches/version-2_5-dev/html/install/sql/create_table_mysql.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 18818)
+++ branches/version-2_5-dev/html/install/sql/create_table_mysql.sql	(revision 18819)
@@ -307,7 +307,4 @@
     update_date datetime,
     deliv_date_id int,
-    down smallint NOT NULL DEFAULT 0,
-    down_filename text,
-    down_realfilename text,
     PRIMARY KEY (product_id)
 ) TYPE=InnoDB;
@@ -329,4 +326,7 @@
     create_date datetime NOT NULL,
     update_date datetime,
+    down smallint NOT NULL ,
+    down_filename text,
+    down_realfilename text,
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (product_class_id)
@@ -656,4 +656,5 @@
     memo09 text,
     memo10 text,
+    payment_date timestamp,
     PRIMARY KEY (order_id)
 ) TYPE=InnoDB;
Index: branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql
===================================================================
--- branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	(revision 18818)
+++ branches/version-2_5-dev/html/install/sql/create_table_pgsql.sql	(revision 18819)
@@ -307,7 +307,4 @@
     update_date timestamp,
     deliv_date_id int,
-    down smallint NOT NULL DEFAULT 0,
-    down_filename text,
-    down_realfilename text,
     PRIMARY KEY (product_id)
 );
@@ -329,4 +326,7 @@
     create_date timestamp NOT NULL DEFAULT now(),
     update_date timestamp,
+    down int2 NOT NULL ,
+    down_filename text,
+    down_realfilename text,
     del_flg smallint NOT NULL DEFAULT 0,
     PRIMARY KEY (product_class_id)
@@ -658,4 +658,5 @@
     memo09 text,
     memo10 text,
+    payment_date timestamp,
     PRIMARY KEY (order_id)
 );
