ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 6633


Ignore:
Timestamp:
Apr 18, 2008, 8:07:46 PM (12 years ago)
Author:
ebihara
Message:

#2090:c_diary_comment_summary->c_diary_comment_log

Location:
OpenPNE/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/setup/sql/mysql41/update/update-for2.12-db-tuning.sql

    r6632 r6633  
    99
    1010/* 日記コメント記入履歴Table */
    11 CREATE TABLE `c_diary_comment_summary` (
    12   `c_diary_comment_summary_id` int(11) NOT NULL auto_increment,
     11CREATE TABLE `c_diary_comment_log` (
     12  `c_diary_comment_log_id` int(11) NOT NULL auto_increment,
    1313  `c_member_id` int(11) NOT NULL default '0',
    1414  `c_diary_id`  int(11) NOT NULL default '0',
    1515  `r_datetime`  datetime NOT NULL default '0000-00-00 00:00:00',
    16   PRIMARY KEY (`c_diary_comment_summary_id`)
     16  PRIMARY KEY (`c_diary_comment_log_id`)
    1717) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    1818
    19 CREATE INDEX `c_member_id_r_datetime` ON `c_diary_comment_summary`(c_member_id,r_datetime);
    20 CREATE INDEX `c_diary_id` ON `c_diary_comment_summary`(c_diary_id);
    21 CREATE INDEX `c_diary_id_r_datetime` ON `c_diary_comment_summary`(c_diary_id,r_datetime);
    22 CREATE INDEX `c_member_id_c_diary_id` ON `c_diary_comment_summary`(c_member_id,c_diary_id);
     19CREATE INDEX `c_member_id_r_datetime` ON `c_diary_comment_log`(c_member_id,r_datetime);
     20CREATE INDEX `c_diary_id` ON `c_diary_comment_log`(c_diary_id);
     21CREATE INDEX `c_diary_id_r_datetime` ON `c_diary_comment_log`(c_diary_id,r_datetime);
     22CREATE INDEX `c_member_id_c_diary_id` ON `c_diary_comment_log`(c_member_id,c_diary_id);
    2323
    2424/* 既存データのコンバート */
  • OpenPNE/trunk/webapp/lib/db/diary.php

    r6631 r6633  
    544544
    545545    $sql = 'SELECT c_diary_id, r_datetime as maxdate' .
    546            ' FROM c_diary_comment_summary' .
     546           ' FROM c_diary_comment_log' .
    547547           ' WHERE c_member_id = ?' .
    548548           ' ORDER BY maxdate DESC';
     
    566566{
    567567    $sql = 'SELECT c_diary_id, c_member_id, r_datetime' .
    568            ' FROM c_diary_comment_summary' .
     568           ' FROM c_diary_comment_log' .
    569569           ' WHERE c_member_id = ?' .
    570570           ' ORDER BY r_datetime DESC';
     
    580580
    581581    $sql = 'SELECT c_diary_id' .
    582            ' FROM c_diary_comment_summary' .
     582           ' FROM c_diary_comment_log' .
    583583           ' WHERE c_member_id = ?';
    584584    $params = array(intval($c_member_id));
     
    10441044    }
    10451045
    1046     $sql = 'DELETE FROM c_diary_comment_summary WHERE c_diary_id = ?';
     1046    $sql = 'DELETE FROM c_diary_comment_log WHERE c_diary_id = ?';
    10471047    db_query($sql, $params);
    10481048
     
    11871187 * @param  int    $c_diary_id
    11881188 */
    1189 function db_diary_insert_c_diary_comment_summary($c_member_id, $c_diary_id)
    1190 {
    1191     $sql = 'SELECT c_diary_id FROM c_diary_comment_summary'
     1189function db_diary_insert_c_diary_comment_log($c_member_id, $c_diary_id)
     1190{
     1191    $sql = 'SELECT c_diary_id FROM c_diary_comment_log'
    11921192         . ' WHERE c_member_id = ? AND c_diary_id = ?';
    11931193    $params = array(intval($c_member_id),intval($c_diary_id));
     
    11991199            'r_datetime' => db_now(),
    12001200        );
    1201         $ins_id = db_insert('c_diary_comment_summary', $data);
     1201        $ins_id = db_insert('c_diary_comment_log', $data);
    12021202    }
    12031203}
     
    12081208 * @param  int    $c_diary_id
    12091209 */
    1210 function db_diary_update_c_diary_comment_summary($c_diary_id)
     1210function db_diary_update_c_diary_comment_log($c_diary_id)
    12111211{
    12121212    $data = array(
     
    12141214    );
    12151215    $where = array('c_diary_id' => intval($c_diary_id));
    1216     $rtn = db_update('c_diary_comment_summary',$data,$where);
     1216    $rtn = db_update('c_diary_comment_log',$data,$where);
    12171217    return array($ins_id,$rtn);
    12181218}
     
    12271227 *
    12281228 */
    1229 function db_diary_delete_c_diary_comment_summary($c_member_id, $c_diary_id)
     1229function db_diary_delete_c_diary_comment_log($c_member_id, $c_diary_id)
    12301230{
    12311231    // 投稿したコメントの有無
     
    12361236    // コメントが無ければ履歴削除
    12371237    if(!$count){
    1238         $sql = 'DELETE FROM c_diary_comment_summary'
     1238        $sql = 'DELETE FROM c_diary_comment_log'
    12391239             . ' WHERE c_member_id = ? AND c_diary_id = ?';
    12401240        $params = array(intval($c_member_id),intval($c_diary_id));
     
    12501250    );
    12511251    $where = array('c_diary_id' => intval($c_diary_id));
    1252     $rtn = db_update('c_diary_comment_summary',$data,$where);
     1252    $rtn = db_update('c_diary_comment_log',$data,$where);
    12531253}
    12541254
  • OpenPNE/trunk/webapp/modules/ktai/do/fh_diary_delete_c_diary_comment.php

    r6631 r6633  
    3535
    3636        //コメント記入履歴削除実行
    37         db_diary_delete_c_diary_comment_summary($target_c_member_id,$c_diary_comment['c_diary_id']);
     37        db_diary_delete_c_diary_comment_log($target_c_member_id,$c_diary_comment['c_diary_id']);
    3838
    3939        $p = array('target_c_diary_id' => $c_diary['c_diary_id']);
  • OpenPNE/trunk/webapp/modules/ktai/do/fh_diary_insert_c_diary_comment.php

    r6631 r6633  
    4747        //日記コメント記入履歴追加
    4848        if ($u != $target_c_member_id) {
    49             db_diary_insert_c_diary_comment_summary($u,$target_c_diary_id);
     49            db_diary_insert_c_diary_comment_log($u,$target_c_diary_id);
    5050        }
    5151        //日記コメント記入履歴更新
    52         db_diary_update_c_diary_comment_summary($target_c_diary_id);
     52        db_diary_update_c_diary_comment_log($target_c_diary_id);
    5353
    5454        //日記コメントが書き込まれたので日記自体を未読扱いにする
  • OpenPNE/trunk/webapp/modules/pc/do/fh_diary_delete_c_diary_comment.php

    r6631 r6633  
    3737
    3838            //コメント記入履歴削除実行
    39             db_diary_delete_c_diary_comment_summary($target_c_diary_comment['c_member_id'],$target_c_diary_id);
     39            db_diary_delete_c_diary_comment_log($target_c_diary_comment['c_member_id'],$target_c_diary_id);
    4040        }
    4141
  • OpenPNE/trunk/webapp/modules/pc/do/fh_diary_insert_c_diary_comment.php

    r6631 r6633  
    5858        //日記コメント記入履歴更新
    5959        if ($u != $target_c_member_id) {
    60             db_diary_insert_c_diary_comment_summary($u,$target_c_diary_id);
     60            db_diary_insert_c_diary_comment_log($u,$target_c_diary_id);
    6161        }
    62         db_diary_update_c_diary_comment_summary($target_c_diary_id);
     62        db_diary_update_c_diary_comment_log($target_c_diary_id);
    6363
    6464        //日記コメントが書き込まれたので日記自体を未読扱いにする
Note: See TracChangeset for help on using the changeset viewer.