Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96244008
20140805.boardcol.2.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
Tue, Dec 24, 02:39
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Dec 26, 02:39 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23117484
Attached To
rPH Phabricator
20140805.boardcol.2.php
View Options
<?php
// Was PhabricatorEdgeConfig::TYPE_COLUMN_HAS_OBJECT
$type_has_object
=
44
;
$column
=
new
PhabricatorProjectColumn
();
$conn_w
=
$column
->
establishConnection
(
'w'
);
$rows
=
queryfx_all
(
$conn_w
,
'SELECT src, dst FROM %T WHERE type = %d'
,
PhabricatorEdgeConfig
::
TABLE_NAME_EDGE
,
$type_has_object
);
$cols
=
array
();
foreach
(
$rows
as
$row
)
{
$cols
[
$row
[
'src'
]][]
=
$row
[
'dst'
];
}
$sql
=
array
();
foreach
(
$cols
as
$col_phid
=>
$obj_phids
)
{
echo
"Migrating column '{$col_phid}'...
\n
"
;
$column
=
id
(
new
PhabricatorProjectColumn
())->
loadOneWhere
(
'phid = %s'
,
$col_phid
);
if
(!
$column
)
{
echo
"Column '{$col_phid}' does not exist.
\n
"
;
continue
;
}
$sequence
=
0
;
foreach
(
$obj_phids
as
$obj_phid
)
{
$sql
[]
=
qsprintf
(
$conn_w
,
'(%s, %s, %s, %d)'
,
$column
->
getProjectPHID
(),
$column
->
getPHID
(),
$obj_phid
,
$sequence
++);
}
}
echo
"Inserting rows...
\n
"
;
foreach
(
PhabricatorLiskDAO
::
chunkSQL
(
$sql
)
as
$chunk
)
{
queryfx
(
$conn_w
,
'INSERT INTO %T (boardPHID, columnPHID, objectPHID, sequence)
VALUES %Q'
,
id
(
new
PhabricatorProjectColumnPosition
())->
getTableName
(),
$chunk
);
}
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment