1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00
phorge-phorge/resources/sql/autopatches/20140210.projcfield.1.blurb.php

26 lines
671 B
PHP
Raw Normal View History

<?php
$conn_w = id(new PhabricatorProject())->establishConnection('w');
$table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'project_profile');
echo pht('Migrating project descriptions to custom storage...')."\n";
foreach ($rows as $row) {
$phid = $row['projectPHID'];
$desc = $row['blurb'];
if (strlen($desc)) {
queryfx(
$conn_w,
'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue)
VALUES (%s, %s, %s)',
$table_name,
$phid,
PhabricatorHash::digestForIndex('std:project:internal:description'),
$desc);
}
}
echo pht('Done.')."\n";