Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140212.dx.1.armageddon.php
| <?php | <?php | ||||
| $conn_w = id(new DifferentialRevision())->establishConnection('w'); | $conn_w = id(new DifferentialRevision())->establishConnection('w'); | ||||
| $rows = new LiskRawMigrationIterator($conn_w, 'differential_comment'); | $rows = new LiskRawMigrationIterator($conn_w, 'differential_comment'); | ||||
| $content_source = PhabricatorContentSource::newForSource( | $content_source = PhabricatorContentSource::newForSource( | ||||
| PhabricatorContentSource::SOURCE_LEGACY, | PhabricatorContentSource::SOURCE_LEGACY, | ||||
| array())->serialize(); | array())->serialize(); | ||||
| echo "Migrating Differential comments to modern storage...\n"; | echo pht('Migrating Differential 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"; | ||||
| $revision = id(new DifferentialRevision())->load($row['revisionID']); | $revision = id(new DifferentialRevision())->load($row['revisionID']); | ||||
| if (!$revision) { | if (!$revision) { | ||||
| echo "No revision, continuing.\n"; | echo pht('No revision, continuing.')."\n"; | ||||
| continue; | continue; | ||||
| } | } | ||||
| $revision_phid = $revision->getPHID(); | $revision_phid = $revision->getPHID(); | ||||
| $comments = queryfx_all( | $comments = queryfx_all( | ||||
| $conn_w, | $conn_w, | ||||
| 'SELECT * FROM %T WHERE legacyCommentID = %d', | 'SELECT * FROM %T WHERE legacyCommentID = %d', | ||||
| ▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | queryfx( | ||||
| json_encode($meta), | json_encode($meta), | ||||
| // dates | // dates | ||||
| $row['dateCreated'], | $row['dateCreated'], | ||||
| $row['dateModified']); | $row['dateModified']); | ||||
| } | } | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||