Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F437962
emailtableport.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
873 B
Referenced Files
None
Subscribers
None
emailtableport.php
View Options
<?php
echo
pht
(
'Migrating user emails...'
).
"
\n
"
;
$table
=
new
PhabricatorUser
();
$table
->
openTransaction
();
$conn
=
$table
->
establishConnection
(
'w'
);
$emails
=
queryfx_all
(
$conn
,
'SELECT phid, email FROM %T LOCK IN SHARE MODE'
,
$table
->
getTableName
());
$emails
=
ipull
(
$emails
,
'email'
,
'phid'
);
$etable
=
new
PhabricatorUserEmail
();
foreach
(
$emails
as
$phid
=>
$email
)
{
// NOTE: Grandfather all existing email in as primary / verified. We generate
// verification codes because they are used for password resets, etc.
echo
pht
(
"Migrating '%s'..."
,
$phid
).
"
\n
"
;
queryfx
(
$conn
,
'INSERT INTO %T (userPHID, address, verificationCode, isVerified, isPrimary)
VALUES (%s, %s, %s, 1, 1)'
,
$etable
->
getTableName
(),
$phid
,
$email
,
Filesystem
::
readRandomCharacters
(
24
));
}
$table
->
saveTransaction
();
echo
pht
(
'Done.'
).
"
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 2:01 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
63047
Default Alt Text
emailtableport.php (873 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment