Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140210.projcfield.1.blurb.php
| <?php | <?php | ||||
| $conn_w = id(new PhabricatorProject())->establishConnection('w'); | $conn_w = id(new PhabricatorProject())->establishConnection('w'); | ||||
| $table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName(); | $table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName(); | ||||
| $rows = new LiskRawMigrationIterator($conn_w, 'project_profile'); | $rows = new LiskRawMigrationIterator($conn_w, 'project_profile'); | ||||
| echo "Migrating project descriptions to custom storage...\n"; | echo pht('Migrating project descriptions to custom storage...')."\n"; | ||||
| foreach ($rows as $row) { | foreach ($rows as $row) { | ||||
| $phid = $row['projectPHID']; | $phid = $row['projectPHID']; | ||||
| echo "Migrating {$phid}...\n"; | |||||
| $desc = $row['blurb']; | $desc = $row['blurb']; | ||||
| if (strlen($desc)) { | if (strlen($desc)) { | ||||
| 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, | ||||
| $phid, | $phid, | ||||
| PhabricatorHash::digestForIndex('std:project:internal:description'), | PhabricatorHash::digestForIndex('std:project:internal:description'), | ||||
| $desc); | $desc); | ||||
| } | } | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||