Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140725.audit.1.migxactions.php
| <?php | <?php | ||||
| $conn_w = id(new PhabricatorAuditTransaction())->establishConnection('w'); | $conn_w = id(new PhabricatorAuditTransaction())->establishConnection('w'); | ||||
| $rows = new LiskRawMigrationIterator($conn_w, 'audit_comment'); | $rows = new LiskRawMigrationIterator($conn_w, 'audit_comment'); | ||||
| $content_source = PhabricatorContentSource::newForSource( | $content_source = PhabricatorContentSource::newForSource( | ||||
| PhabricatorContentSource::SOURCE_LEGACY, | PhabricatorContentSource::SOURCE_LEGACY, | ||||
| array())->serialize(); | array())->serialize(); | ||||
| echo "Migrating Audit comments to modern storage...\n"; | echo pht('Migrating Audit comments to modern storage...')."\n"; | ||||
| foreach ($rows as $row) { | foreach ($rows as $row) { | ||||
| $id = $row['id']; | $id = $row['id']; | ||||
| echo "Migrating comment {$id}...\n"; | echo pht('Migrating comment %d...', $id)."\n"; | ||||
| $comments = queryfx_all( | $comments = queryfx_all( | ||||
| $conn_w, | $conn_w, | ||||
| 'SELECT * FROM %T WHERE legacyCommentID = %d', | 'SELECT * FROM %T WHERE legacyCommentID = %d', | ||||
| 'audit_transaction_comment', | 'audit_transaction_comment', | ||||
| $id); | $id); | ||||
| $main_comments = array(); | $main_comments = array(); | ||||
| ▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | queryfx( | ||||
| // dates | // dates | ||||
| $row['dateCreated'], | $row['dateCreated'], | ||||
| $row['dateModified']); | $row['dateModified']); | ||||
| } | } | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||