Changeset 6634
- Timestamp:
- Apr 18, 2008, 8:54:24 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/trunk/setup/sql/mysql41/update/update-for2.12-db-tuning.sql
r6633 r6634 1 /* コメント記入履歴時間 */2 1 ALTER TABLE c_commu_topic ADD COLUMN u_datetime datetime NOT NULL default '0000-00-00 00:00:00'; 3 2 4 /* Index 変更*/5 3 DROP INDEX r_datetime_c_commu_id ON c_commu_topic; 6 4 CREATE INDEX r_datetime_c_commu_id ON c_commu_topic(c_commu_id,u_datetime); … … 8 6 CREATE INDEX c_commu_id_c_member_id ON c_commu_member(c_commu_id,c_member_id); 9 7 10 /* 日記コメント記入履歴Table */11 8 CREATE TABLE `c_diary_comment_log` ( 12 9 `c_diary_comment_log_id` int(11) NOT NULL auto_increment, … … 22 19 CREATE INDEX `c_member_id_c_diary_id` ON `c_diary_comment_log`(c_member_id,c_diary_id); 23 20 24 /* 既存データのコンバート */25 /* コメント記入履歴時間 */26 21 DROP TABLE IF EXISTS `tmp_c_commu_topic`; 27 22 CREATE TABLE `tmp_c_commu_topic` ( … … 42 37 DROP TABLE tmp_c_commu_topic; 43 38 39 INSERT INTO c_diary_comment_log (NULL, c_member_id, c_diary_id, r_datetime) 40 (SELECT NULL, c_member_id, c_diary_id, MAX(r_datetime) AS r_datetime 41 FROM c_diary_comment 42 WHERE TO_DAYS(NOW()) - TO_DAYS(r_datetime) <= 15 43 GROUP BY c_member_id, c_diary_id 44 ORDER BY r_datetime); 45
Note: See TracChangeset
for help on using the changeset viewer.