Add missing mail keys to Projects
Ref T8216. Auditors: btrahan
This commit is contained in:
2
resources/sql/autopatches/20150515.project.mailkey.1.sql
Normal file
2
resources/sql/autopatches/20150515.project.mailkey.1.sql
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE {$NAMESPACE}_project.project
|
||||||
|
ADD mailKey binary(20) NOT NULL;
|
||||||
18
resources/sql/autopatches/20150515.project.mailkey.2.php
Normal file
18
resources/sql/autopatches/20150515.project.mailkey.2.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$table = new PhabricatorProject();
|
||||||
|
$conn_w = $table->establishConnection('w');
|
||||||
|
$iterator = new LiskMigrationIterator($table);
|
||||||
|
foreach ($iterator as $project) {
|
||||||
|
$id = $project->getID();
|
||||||
|
|
||||||
|
echo pht('Adding mail key for project %d...', $id);
|
||||||
|
echo "\n";
|
||||||
|
|
||||||
|
queryfx(
|
||||||
|
$conn_w,
|
||||||
|
'UPDATE %T SET mailKey = %s WHERE id = %d',
|
||||||
|
$table->getTableName(),
|
||||||
|
Filesystem::readRandomCharacters(20),
|
||||||
|
$id);
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
|
|||||||
protected $profileImagePHID;
|
protected $profileImagePHID;
|
||||||
protected $icon;
|
protected $icon;
|
||||||
protected $color;
|
protected $color;
|
||||||
|
protected $mailKey;
|
||||||
|
|
||||||
protected $viewPolicy;
|
protected $viewPolicy;
|
||||||
protected $editPolicy;
|
protected $editPolicy;
|
||||||
@@ -142,6 +143,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
|
|||||||
'profileImagePHID' => 'phid?',
|
'profileImagePHID' => 'phid?',
|
||||||
'icon' => 'text32',
|
'icon' => 'text32',
|
||||||
'color' => 'text32',
|
'color' => 'text32',
|
||||||
|
'mailKey' => 'bytes20',
|
||||||
|
|
||||||
// T6203/NULLABILITY
|
// T6203/NULLABILITY
|
||||||
// These are definitely wrong and should always exist.
|
// These are definitely wrong and should always exist.
|
||||||
|
|||||||
Reference in New Issue
Block a user