Merge branch 'master' into blender-tweaks

This commit is contained in:
2019-12-17 13:02:09 +01:00
142 changed files with 3039 additions and 997 deletions

View File

@@ -0,0 +1,4 @@
<?php
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery(
'PhabricatorRepositoryQuery');

View File

@@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_repository.repository_identity
ADD emailAddress VARCHAR(255) COLLATE {$COLLATE_SORT};

View File

@@ -0,0 +1,26 @@
<?php
$table = new PhabricatorRepositoryIdentity();
$conn = $table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
foreach ($iterator as $row) {
$name = $row['identityNameRaw'];
$name = phutil_utf8ize($name);
$email = new PhutilEmailAddress($name);
$address = $email->getAddress();
try {
queryfx(
$conn,
'UPDATE %R SET emailAddress = %ns WHERE id = %d',
$table,
$address,
$row['id']);
} catch (Exception $ex) {
// We may occasionally run into issues with binary or very long addresses.
// Just skip over them.
continue;
}
}

View File

@@ -0,0 +1,3 @@
UPDATE {$NAMESPACE}_repository.repository_identity
SET currentEffectiveUserPHID = NULL
WHERE currentEffectiveUserPHID = 'unassigned()';

View File

@@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_user.user_email
ADD phid VARBINARY(64) NOT NULL;

View File

@@ -0,0 +1,18 @@
<?php
$table = new PhabricatorUserEmail();
$conn = $table->establishConnection('w');
$iterator = new LiskRawMigrationIterator($conn, $table->getTableName());
foreach ($iterator as $row) {
$phid = $row['phid'];
if (!strlen($phid)) {
queryfx(
$conn,
'UPDATE %R SET phid = %s WHERE id = %d',
$table,
$table->generatePHID(),
$row['id']);
}
}