Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140226.dxcustom.1.fielddata.php
| <?php | <?php | ||||
| $conn_w = id(new DifferentialRevision())->establishConnection('w'); | $conn_w = id(new DifferentialRevision())->establishConnection('w'); | ||||
| $rows = new LiskRawMigrationIterator($conn_w, 'differential_auxiliaryfield'); | $rows = new LiskRawMigrationIterator($conn_w, 'differential_auxiliaryfield'); | ||||
| echo "Modernizing Differential auxiliary field storage...\n"; | echo pht('Modernizing Differential auxiliary field storage...')."\n"; | ||||
| $table_name = id(new DifferentialCustomFieldStorage())->getTableName(); | $table_name = id(new DifferentialCustomFieldStorage())->getTableName(); | ||||
| foreach ($rows as $row) { | foreach ($rows as $row) { | ||||
| $id = $row['id']; | $id = $row['id']; | ||||
| echo "Migrating row {$id}...\n"; | echo pht('Migrating row %d...', $id)."\n"; | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue) | 'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue) | ||||
| VALUES (%s, %s, %s)', | VALUES (%s, %s, %s)', | ||||
| $table_name, | $table_name, | ||||
| $row['revisionPHID'], | $row['revisionPHID'], | ||||
| PhabricatorHash::digestForIndex($row['name']), | PhabricatorHash::digestForIndex($row['name']), | ||||
| $row['value']); | $row['value']); | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||