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

Changeset 11589


Ignore:
Timestamp:
May 7, 2009, 10:29:38 AM (11 years ago)
Author:
fukamachi
Message:

DBコンバータ - deleted_messageテーブルの変換に対応。また関連付けのため、message_send_listの変換を修正

Location:
OpenPNE/branches/work/fukamachi/db_converter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/work/fukamachi/db_converter/db_converter.php

    r11553 r11589  
    366366{
    367367    $result = $dbh->query($sql['sql']);
     368    dbdie($result, $sql['sql']);
     369
    368370    return sql_add_increment_column($result, $sql['table'], $sql['column'], 1);
    369371}
     
    392394    }
    393395}
     396
     397function table_message_send_list_sql($dbh, $sql)
     398{
     399    $result = $dbh->query($sql['sql']);
     400    dbdie($result, $sql['sql']);
     401
     402    return sql_add_increment_column($result, $sql['table'], $sql['column'], 1);
     403}
     404
     405function table_deleted_message_sql($dbh, $sql)
     406{
     407    $result = $dbh->query($sql['sql']);
     408    dbdie($result, $sql['sql']);
     409
     410    $row_ary = array();
     411    $i = 0;
     412    while ($row = $result->fetchRow()) {
     413        ++$i;
     414        $row[2] = $i;
     415        array_push($row, $i);
     416        array_push($row_ary, $row);
     417    }
     418
     419    return generate_insert_sql_with_array($row_ary, $sql['table'], $sql['column']);
     420}
     421
    394422?>
  • OpenPNE/branches/work/fukamachi/db_converter/db_relation.yml

    r11553 r11589  
    134134
    135135- table: deleted_message
    136    #!!!message_send_list_id
     136  special: 1
    137137  column: [id, member_id, message_id, message_send_list_id, is_deleted, created_at, updated_at]
    138138  sql: >
    139139    SELECT
    140         is_deleted_from as member_id,
     140        c_member_id_to as member_id,
    141141        c_message_id as message_id,
    142         is_kanzen_sakujo_from as is_deleted,
     142        NULL as message_send_list_id,
     143        is_kanzen_sakujo_to as is_deleted,
     144        r_datetime as created_at,
    143145        r_datetime as created_at
    144146    FROM c_message
    145     UNION
    146     SELECT
    147         is_deleted_to as member_id,
    148         c_message_id as message_id,
    149         is_kanzen_sakujo_to as is_deleted,
    150         r_datetime as created_at
    151     FROM c_message
     147    WHERE is_deleted_to = 1
     148    ORDER BY c_message_id
    152149
    153150- table: diary
     
    477474
    478475- table: message_send_list
    479   column: [member_id, message_id, is_read, is_deleted, created_at]
    480   sql: >
    481     SELECT
    482         c_message_id as id,
     476  special: 1
     477  column: [id, member_id, message_id, is_read, is_deleted, created_at]
     478  sql: >
     479    SELECT
    483480        c_member_id_to as member_id,
    484481        c_message_id as message_id,
     
    487484        r_datetime as created_at
    488485    FROM c_message
     486    ORDER BY c_message_id
    489487
    490488- table: navigation
Note: See TracChangeset for help on using the changeset viewer.