mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-21 11:09:02 +01:00
parent
fa82c17079
commit
72a896f772
3 changed files with 22 additions and 0 deletions
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.
|
||||||
|
|
Loading…
Add table
Reference in a new issue