Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91408290
20130915.maniphestmigrate.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 10, 20:04
Size
674 B
Mime Type
text/x-php
Expires
Tue, Nov 12, 20:04 (2 d)
Engine
blob
Format
Raw Data
Handle
22256883
Attached To
rPH Phabricator
20130915.maniphestmigrate.php
View Options
<?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
"
;
Event Timeline
Log In to Comment