@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator

Add missing mail keys to Projects

Ref T8216.

Auditors: btrahan

+22
+2
resources/sql/autopatches/20150515.project.mailkey.1.sql
··· 1 + ALTER TABLE {$NAMESPACE}_project.project 2 + ADD mailKey binary(20) NOT NULL;
+18
resources/sql/autopatches/20150515.project.mailkey.2.php
··· 1 + <?php 2 + 3 + $table = new PhabricatorProject(); 4 + $conn_w = $table->establishConnection('w'); 5 + $iterator = new LiskMigrationIterator($table); 6 + foreach ($iterator as $project) { 7 + $id = $project->getID(); 8 + 9 + echo pht('Adding mail key for project %d...', $id); 10 + echo "\n"; 11 + 12 + queryfx( 13 + $conn_w, 14 + 'UPDATE %T SET mailKey = %s WHERE id = %d', 15 + $table->getTableName(), 16 + Filesystem::readRandomCharacters(20), 17 + $id); 18 + }
+2
src/applications/project/storage/PhabricatorProject.php
··· 17 17 protected $profileImagePHID; 18 18 protected $icon; 19 19 protected $color; 20 + protected $mailKey; 20 21 21 22 protected $viewPolicy; 22 23 protected $editPolicy; ··· 142 143 'profileImagePHID' => 'phid?', 143 144 'icon' => 'text32', 144 145 'color' => 'text32', 146 + 'mailKey' => 'bytes20', 145 147 146 148 // T6203/NULLABILITY 147 149 // These are definitely wrong and should always exist.