1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 09:12:41 +01:00
phorge-phorge/resources/sql/autopatches/20140210.projcfield.1.blurb.php
epriestley 1520065ec0 Migrate project blurb/description to standard custom field storage
Summary: Ref T4379. Major goal here is to remove `ProjectProfile` so all edits use ApplicationTransactions. This also makes things more flexible, allowing users to disable this field if they don't like it.

Test Plan: Ran migration, verified data survived, edited/created projects, reordered fields.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4379

Differential Revision: https://secure.phabricator.com/D8182
2014-02-10 14:31:57 -08:00

26 lines
688 B
PHP

<?php
$conn_w = id(new PhabricatorProject())->establishConnection('w');
$table_name = id(new PhabricatorProjectCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'project_profile');
echo "Migrating project descriptions to custom storage...\n";
foreach ($rows as $row) {
$phid = $row['projectPHID'];
echo "Migrating {$phid}...\n";
$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 "Done.\n";