Merge branch 'master' into blender-tweaks
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
PhabricatorRebuildIndexesWorker::rebuildObjectsWithQuery(
|
||||
'PhabricatorRepositoryQuery');
|
||||
2
resources/sql/autopatches/20191113.identity.01.email.sql
Normal file
2
resources/sql/autopatches/20191113.identity.01.email.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE {$NAMESPACE}_repository.repository_identity
|
||||
ADD emailAddress VARCHAR(255) COLLATE {$COLLATE_SORT};
|
||||
26
resources/sql/autopatches/20191113.identity.02.populate.php
Normal file
26
resources/sql/autopatches/20191113.identity.02.populate.php
Normal 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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
UPDATE {$NAMESPACE}_repository.repository_identity
|
||||
SET currentEffectiveUserPHID = NULL
|
||||
WHERE currentEffectiveUserPHID = 'unassigned()';
|
||||
2
resources/sql/autopatches/20191114.email.01.phid.sql
Normal file
2
resources/sql/autopatches/20191114.email.01.phid.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE {$NAMESPACE}_user.user_email
|
||||
ADD phid VARBINARY(64) NOT NULL;
|
||||
18
resources/sql/autopatches/20191114.email.02.populate.php
Normal file
18
resources/sql/autopatches/20191114.email.02.populate.php
Normal 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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user