Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2349190
20130820.file-mailkey-populate.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
709 B
Referenced Files
None
Subscribers
None
20130820.file-mailkey-populate.php
View Options
<?php
echo
"Populating Phabricator files with mail keys xactions...
\n
"
;
$table
=
new
PhabricatorFile
();
$table_name
=
$table
->
getTableName
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
$conn_w
->
openTransaction
();
$sql
=
array
();
foreach
(
new
LiskRawMigrationIterator
(
$conn_w
,
'file'
)
as
$row
)
{
$sql
[]
=
qsprintf
(
$conn_w
,
'(%d, %s)'
,
$row
[
'id'
],
Filesystem
::
readRandomCharacters
(
20
));
}
if
(
$sql
)
{
foreach
(
PhabricatorLiskDAO
::
chunkSQL
(
$sql
,
', '
)
as
$chunk
)
{
queryfx
(
$conn_w
,
'INSERT INTO %T (id, mailKey) VALUES %Q '
.
'ON DUPLICATE KEY UPDATE mailKey = VALUES(mailKey)'
,
$table_name
,
$chunk
);
}
}
$table
->
saveTransaction
();
echo
"Done.
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Sep 16, 11:25 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
445984
Default Alt Text
20130820.file-mailkey-populate.php (709 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment