Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96153885
20140521.projectslug.2.mig.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
Mon, Dec 23, 05:49
Size
917 B
Mime Type
text/x-php
Expires
Wed, Dec 25, 05:49 (2 d)
Engine
blob
Format
Raw Data
Handle
23134435
Attached To
rPH Phabricator
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
"Migrating project phriction slugs...
\n
"
;
foreach
(
new
LiskMigrationIterator
(
$project_table
)
as
$project
)
{
$id
=
$project
->
getID
();
echo
"Migrating project {$id}...
\n
"
;
$phriction_slug
=
rtrim
(
$project
->
getPhrictionSlug
(),
'/'
);
$slug
=
id
(
new
PhabricatorProjectSlug
())
->
loadOneWhere
(
'slug = %s'
,
$phriction_slug
);
if
(
$slug
)
{
echo
"Already migrated {$id}... Continuing.
\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
"Migrated {$id}.
\n
"
;
}
echo
"Done.
\n
"
;
Event Timeline
Log In to Comment