diff --git a/resources/sql/autopatches/20180730.project.01.spaces.sql b/resources/sql/autopatches/20180730.project.01.spaces.sql new file mode 100644 index 0000000000..927ff3b677 --- /dev/null +++ b/resources/sql/autopatches/20180730.project.01.spaces.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_project.project + ADD COLUMN spacePHID VARBINARY(64) DEFAULT NULL; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 568c715ea1..981764dc7a 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -9752,6 +9752,7 @@ phutil_register_library_map(array( 'PhabricatorFerretInterface', 'PhabricatorConduitResultInterface', 'PhabricatorColumnProxyInterface', + 'PhabricatorSpacesInterface', ), 'PhabricatorProjectAddHeraldAction' => 'PhabricatorProjectHeraldAction', 'PhabricatorProjectApplication' => 'PhabricatorApplication', diff --git a/src/applications/project/storage/PhabricatorProject.php b/src/applications/project/storage/PhabricatorProject.php index 4ec4b63675..aa035aedf5 100644 --- a/src/applications/project/storage/PhabricatorProject.php +++ b/src/applications/project/storage/PhabricatorProject.php @@ -11,7 +11,8 @@ final class PhabricatorProject extends PhabricatorProjectDAO PhabricatorFulltextInterface, PhabricatorFerretInterface, PhabricatorConduitResultInterface, - PhabricatorColumnProxyInterface { + PhabricatorColumnProxyInterface, + PhabricatorSpacesInterface { protected $name; protected $status = PhabricatorProjectStatus::STATUS_ACTIVE; @@ -38,6 +39,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO protected $projectPathKey; protected $properties = array(); + protected $spacePHID; private $memberPHIDs = self::ATTACHABLE; private $watcherPHIDs = self::ATTACHABLE; @@ -82,6 +84,7 @@ final class PhabricatorProject extends PhabricatorProjectDAO ->setViewPolicy($view_policy) ->setEditPolicy($edit_policy) ->setJoinPolicy($join_policy) + ->setSpacePHID($actor->getDefaultSpacePHID()) ->setIsMembershipLocked(0) ->attachMemberPHIDs(array()) ->attachSlugs(array()) @@ -697,6 +700,14 @@ final class PhabricatorProject extends PhabricatorProjectDAO } +/* -( PhabricatorSpacesInterface )----------------------------------------- */ + + + public function getSpacePHID() { + return $this->spacePHID; + } + + /* -( PhabricatorDestructibleInterface )----------------------------------- */