1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 10:52:41 +01:00
phorge-phorge/resources/sql/patches/20130915.maniphestmigrate.php

26 lines
674 B
PHP
Raw Normal View History

<?php
$conn_w = id(new ManiphestTask())->establishConnection('w');
$table_name = id(new ManiphestCustomFieldStorage())->getTableName();
$rows = new LiskRawMigrationIterator($conn_w, 'maniphest_taskauxiliarystorage');
echo pht('Migrating custom storage for Maniphest fields...')."\n";
foreach ($rows as $row) {
$phid = $row['taskPHID'];
$name = $row['name'];
echo pht('Migrating %s / %s...', $phid, $name)."\n";
queryfx(
$conn_w,
'INSERT IGNORE INTO %T (objectPHID, fieldIndex, fieldValue)
VALUES (%s, %s, %s)',
$table_name,
$phid,
PhabricatorHash::digestForIndex('std:maniphest:'.$name),
$row['value']);
}
echo pht('Done.')."\n";