1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Add missing mail keys to Projects

Ref T8216.

Auditors: btrahan
This commit is contained in:
epriestley 2015-05-16 06:13:27 -07:00
parent fa82c17079
commit 72a896f772
3 changed files with 22 additions and 0 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE {$NAMESPACE}_project.project
ADD mailKey binary(20) NOT NULL;

View 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);
}

View file

@ -17,6 +17,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
protected $profileImagePHID;
protected $icon;
protected $color;
protected $mailKey;
protected $viewPolicy;
protected $editPolicy;
@ -142,6 +143,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO
'profileImagePHID' => 'phid?',
'icon' => 'text32',
'color' => 'text32',
'mailKey' => 'bytes20',
// T6203/NULLABILITY
// These are definitely wrong and should always exist.