Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F17817942
D17060.id41034.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D17060.id41034.diff
View Options
diff --git a/resources/sql/autopatches/20140521.projectslug.2.mig.php b/resources/sql/autopatches/20140521.projectslug.2.mig.php
--- a/resources/sql/autopatches/20140521.projectslug.2.mig.php
+++ b/resources/sql/autopatches/20140521.projectslug.2.mig.php
@@ -4,27 +4,30 @@
$table_name = $project_table->getTableName();
$conn_w = $project_table->establishConnection('w');
$slug_table_name = id(new PhabricatorProjectSlug())->getTableName();
-$time = time();
+$time = PhabricatorTime::getNow();
-echo pht('Migrating project phriction slugs...')."\n";
+echo pht('Migrating projects to 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_text = PhabricatorSlug::normalizeProjectSlug($project->getName());
$slug = id(new PhabricatorProjectSlug())
- ->loadOneWhere('slug = %s', $phriction_slug);
+ ->loadOneWhere('slug = %s', $slug_text);
+
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,
+ $slug_text,
$time,
$time);
echo pht('Migrated %d.', $id)."\n";
diff --git a/resources/sql/patches/090.forceuniqueprojectnames.php b/resources/sql/patches/090.forceuniqueprojectnames.php
--- a/resources/sql/patches/090.forceuniqueprojectnames.php
+++ b/resources/sql/patches/090.forceuniqueprojectnames.php
@@ -96,7 +96,9 @@
if ($other->getID() == $project->getID()) {
continue;
}
- if ($other->getPhrictionSlug() == $new_slug) {
+
+ $other_slug = PhabricatorSlug::normalizeProjectSlug($other->getName());
+ if ($other_slug == $new_slug) {
$okay = false;
break;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 27 2025, 12:00 AM (4 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8540835
Default Alt Text
D17060.id41034.diff (1 KB)
Attached To
Mode
D17060: Probably (?) fix two very old project slug migrations
Attached
Detach File
Event Timeline
Log In to Comment