1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-28 16:30:59 +01:00

Stop writing empty strings to the ownerPHID column

Summary: If we're unassigning an owner from a task it should set the column to `NULL` rather than an empty string. Fixes T3239

Test Plan: Assigned and Unassigned a task. Make sure the db is doing as excpected. Ran the patch, checked the db.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T3239

Differential Revision: https://secure.phabricator.com/D6017
This commit is contained in:
Gareth Evans 2013-05-23 09:22:18 -07:00 committed by epriestley
parent 689c6f2f30
commit 183bb8c80f
3 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1 @@
update {$NAMESPACE}_maniphest.maniphest_task set ownerPHID = NULL WHERE ownerPHID = '';

View file

@ -90,7 +90,7 @@ final class ManiphestTask extends ManiphestDAO
}
public function setOwnerPHID($phid) {
$this->ownerPHID = $phid;
$this->ownerPHID = nonempty($phid, null);
$this->subscribersNeedUpdate = true;
return $this;
}

View file

@ -1310,6 +1310,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'sql',
'name' => $this->getPatchPath('20130521.dropconphimages.sql'),
),
'20130523.maniphest_owners.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('20130523.maniphest_owners.sql'),
),
);
}