Migrate project profiles onto projects, and remove ProjectProfile object

Summary:
Ref T4379. Long ago, the "Project" vs "ProjectProfile" split was intended to allow a bunch of special fields on projects without burdening the simple use cases, but CustomField handles that far better and far more generally, and doing this makes using ApplicationTransactions a pain to get right, so get rid of it.

The only remaining field is `profileImagePHID`, which we can just move to the main Project object. This is custom enough that I think it's reasonable not to express it as a custom field.

Test Plan: Created a project, set profile, edited project, viewed in typeahead, ran migration, verified database results.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4379

Differential Revision: https://secure.phabricator.com/D8183
This commit is contained in:
epriestley
2014-02-10 14:32:14 -08:00
parent 1520065ec0
commit 8c84ed61b1
12 changed files with 48 additions and 105 deletions

View File

@@ -23,18 +23,17 @@ final class PhabricatorProjectProfileController
->setViewer($user)
->withIDs(array($this->id))
->needMembers(true)
->needProfiles(true)
->needImages(true)
->executeOne();
if (!$project) {
return new Aphront404Response();
}
$profile = $project->getProfile();
$picture = $profile->getProfileImageURI();
$picture = $project->getProfileImageURI();
require_celerity_resource('phabricator-profile-css');
$tasks = $this->renderTasksPage($project, $profile);
$tasks = $this->renderTasksPage($project);
$query = new PhabricatorFeedQuery();
$query->setFilterPHIDs(
@@ -62,9 +61,8 @@ final class PhabricatorProjectProfileController
$header->setStatus('policy-noone', '', pht('Archived'));
}
$actions = $this->buildActionListView($project);
$properties = $this->buildPropertyListView($project, $profile, $actions);
$properties = $this->buildPropertyListView($project, $actions);
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb($project->getName())
@@ -86,9 +84,7 @@ final class PhabricatorProjectProfileController
));
}
private function renderFeedPage(
PhabricatorProject $project,
PhabricatorProjectProfile $profile) {
private function renderFeedPage(PhabricatorProject $project) {
$query = new PhabricatorFeedQuery();
$query->setFilterPHIDs(array($project->getPHID()));
@@ -117,9 +113,7 @@ final class PhabricatorProjectProfileController
}
private function renderTasksPage(
PhabricatorProject $project,
PhabricatorProjectProfile $profile) {
private function renderTasksPage(PhabricatorProject $project) {
$user = $this->getRequest()->getUser();
@@ -244,7 +238,6 @@ final class PhabricatorProjectProfileController
private function buildPropertyListView(
PhabricatorProject $project,
PhabricatorProjectProfile $profile,
PhabricatorActionListView $actions) {
$request = $this->getRequest();
$viewer = $request->getUser();