Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F468878
20140521.projectslug.2.mig.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
963 B
Referenced Files
None
Subscribers
None
20140521.projectslug.2.mig.php
View Options
<?php
$project_table
=
new
PhabricatorProject
();
$table_name
=
$project_table
->
getTableName
();
$conn_w
=
$project_table
->
establishConnection
(
'w'
);
$slug_table_name
=
id
(
new
PhabricatorProjectSlug
())->
getTableName
();
$time
=
time
();
echo
pht
(
'Migrating project phriction slugs...'
).
"
\n
"
;
foreach
(
new
LiskMigrationIterator
(
$project_table
)
as
$project
)
{
$id
=
$project
->
getID
();
echo
pht
(
'Migrating project %d...'
,
$id
).
"
\n
"
;
$phriction_slug
=
rtrim
(
$project
->
getPhrictionSlug
(),
'/'
);
$slug
=
id
(
new
PhabricatorProjectSlug
())
->
loadOneWhere
(
'slug = %s'
,
$phriction_slug
);
if
(
$slug
)
{
echo
pht
(
'Already migrated %d... Continuing.'
,
$id
).
"
\n
"
;
continue
;
}
queryfx
(
$conn_w
,
'INSERT INTO %T (projectPHID, slug, dateCreated, dateModified) '
.
'VALUES (%s, %s, %d, %d)'
,
$slug_table_name
,
$project
->
getPHID
(),
$phriction_slug
,
$time
,
$time
);
echo
pht
(
'Migrated %d.'
,
$id
).
"
\n
"
;
}
echo
pht
(
'Done.'
).
"
\n
"
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, May 6, 6:50 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
81161
Default Alt Text
20140521.projectslug.2.mig.php (963 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment