Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/patches/20130921.xmigratemaniphest.php
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | if ($xaction_type == 'aux') { | ||||
$xaction_meta = json_encode($xaction_meta); | $xaction_meta = json_encode($xaction_meta); | ||||
} | } | ||||
// If this transaction did something other than just leaving a comment, | // If this transaction did something other than just leaving a comment, | ||||
// insert a new transaction for that action. If there was a comment (or | // insert a new transaction for that action. If there was a comment (or | ||||
// a comment in addition to an action) we'll insert that below. | // a comment in addition to an action) we'll insert that below. | ||||
if ($row['transactionType'] != 'comment') { | if ($row['transactionType'] != 'comment') { | ||||
$xaction_phid = PhabricatorPHID::generateNewPHID( | $xaction_phid = PhabricatorPHID::generateNewPHID( | ||||
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST, | PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST, | ||||
ManiphestPHIDTypeTask::TYPECONST); | ManiphestTaskPHIDType::TYPECONST); | ||||
queryfx( | queryfx( | ||||
$conn_w, | $conn_w, | ||||
'INSERT INTO %T (phid, authorPHID, objectPHID, viewPolicy, editPolicy, | 'INSERT INTO %T (phid, authorPHID, objectPHID, viewPolicy, editPolicy, | ||||
commentPHID, commentVersion, transactionType, oldValue, newValue, | commentPHID, commentVersion, transactionType, oldValue, newValue, | ||||
contentSource, metadata, dateCreated, dateModified) | contentSource, metadata, dateCreated, dateModified) | ||||
VALUES (%s, %s, %s, %s, %s, %s, %d, %s, %ns, %ns, %s, %s, %d, %d)', | VALUES (%s, %s, %s, %s, %s, %s, %d, %s, %ns, %ns, %s, %s, %d, %d)', | ||||
$xaction_table_name, | $xaction_table_name, | ||||
Show All 13 Lines | queryfx( | ||||
$row['dateModified']); | $row['dateModified']); | ||||
} | } | ||||
// Now, if the old transaction has a comment, we insert an explicit new | // Now, if the old transaction has a comment, we insert an explicit new | ||||
// transaction for it. | // transaction for it. | ||||
if ($has_comment) { | if ($has_comment) { | ||||
$comment_phid = PhabricatorPHID::generateNewPHID( | $comment_phid = PhabricatorPHID::generateNewPHID( | ||||
PhabricatorPHIDConstants::PHID_TYPE_XCMT, | PhabricatorPHIDConstants::PHID_TYPE_XCMT, | ||||
ManiphestPHIDTypeTask::TYPECONST); | ManiphestTaskPHIDType::TYPECONST); | ||||
$comment_version = 1; | $comment_version = 1; | ||||
$comment_xaction_phid = PhabricatorPHID::generateNewPHID( | $comment_xaction_phid = PhabricatorPHID::generateNewPHID( | ||||
PhabricatorApplicationTransactionPHIDTypeTransaction::TYPECONST, | PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST, | ||||
ManiphestPHIDTypeTask::TYPECONST); | ManiphestTaskPHIDType::TYPECONST); | ||||
// Insert the comment data. | // Insert the comment data. | ||||
queryfx( | queryfx( | ||||
$conn_w, | $conn_w, | ||||
'INSERT INTO %T (phid, transactionPHID, authorPHID, viewPolicy, | 'INSERT INTO %T (phid, transactionPHID, authorPHID, viewPolicy, | ||||
editPolicy, commentVersion, content, contentSource, isDeleted, | editPolicy, commentVersion, content, contentSource, isDeleted, | ||||
dateCreated, dateModified) | dateCreated, dateModified) | ||||
VALUES (%s, %s, %s, %s, %s, %d, %s, %s, %d, %d, %d)', | VALUES (%s, %s, %s, %s, %s, %d, %s, %s, %d, %d, %d)', | ||||
Show All 39 Lines |