3 $conn_w = id(new PhabricatorAuditTransaction())->establishConnection('w');
4 $rows = new LiskRawMigrationIterator($conn_w, 'audit_comment');
6 $content_source = PhabricatorContentSource
::newForSource(
7 PhabricatorOldWorldContentSource
::SOURCECONST
)->serialize();
9 echo pht('Migrating Audit comment text to modern storage...')."\n";
10 foreach ($rows as $row) {
12 echo pht('Migrating Audit comment %d...', $id)."\n";
13 if (!strlen($row['content'])) {
14 echo pht('Comment has no text, continuing.')."\n";
18 $xaction_phid = PhabricatorPHID
::generateNewPHID(
19 PhabricatorApplicationTransactionTransactionPHIDType
::TYPECONST
,
20 PhabricatorRepositoryCommitPHIDType
::TYPECONST
);
22 $comment_phid = PhabricatorPHID
::generateNewPHID(
23 PhabricatorPHIDConstants
::PHID_TYPE_XCMT
,
24 PhabricatorRepositoryCommitPHIDType
::TYPECONST
);
28 'INSERT IGNORE INTO %T
29 (phid, transactionPHID, authorPHID, viewPolicy, editPolicy,
30 commentVersion, content, contentSource, isDeleted,
31 dateCreated, dateModified, commitPHID, pathID,
33 VALUES (%s, %s, %s, %s, %s,
37 'audit_transaction_comment',
39 // phid, transactionPHID, authorPHID, viewPolicy, editPolicy
46 // commentVersion, content, contentSource, isDeleted
52 // dateCreated, dateModified, commitPHID, pathID, legacyCommentID
60 echo pht('Done.')."\n";