From dc6cfe6e013186f94b2cb3a8ab54c56fb1602e20 Mon Sep 17 00:00:00 2001 From: Afaque Hussain Date: Fri, 19 Apr 2013 11:40:13 -0700 Subject: [PATCH] Created PhabricatorExternalAccount Class and Sql patch to create an external_account table. Summary: Created PhabricatorExternalAccount class with only data members. Will discuss with you regarding the necessary functions to be implemented in this class. Sql Patch to create a new table for external_accounts. Will I have to write unit tests the new storage object? Sending you this diff so that you can comment on this to further improve :). Test Plan: {F40977} Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, AnhNhan Maniphest Tasks: T1536, T1205 Differential Revision: https://secure.phabricator.com/D5724 --- .../sql/patches/20130417.externalaccount.sql | 12 ++++++++++++ src/__celerity_resource_map__.php | 2 +- src/__phutil_library_map__.php | 2 ++ .../storage/PhabricatorExternalAccount.php | 17 +++++++++++++++++ .../phid/PhabricatorPHIDConstants.php | 1 + .../patch/PhabricatorBuiltinPatchList.php | 4 ++++ 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 resources/sql/patches/20130417.externalaccount.sql create mode 100644 src/applications/people/storage/PhabricatorExternalAccount.php diff --git a/resources/sql/patches/20130417.externalaccount.sql b/resources/sql/patches/20130417.externalaccount.sql new file mode 100644 index 0000000000..0d87db0afb --- /dev/null +++ b/resources/sql/patches/20130417.externalaccount.sql @@ -0,0 +1,12 @@ + +CREATE TABLE {$NAMESPACE}_user.externalaccount ( + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + phid VARCHAR(64) COLLATE utf8_bin NOT NULL UNIQUE KEY, + userPHID VARCHAR(64) COLLATE utf8_bin, + accountType VARCHAR(16) COLLATE utf8_bin NOT NULL, + accountDomain VARCHAR(64) COLLATE utf8_bin, + accountSecret LONGTEXT COLLATE utf8_bin, + accountID VARCHAR(160) COLLATE utf8_bin NOT NULL, + displayName VARCHAR(256) COLLATE utf8_bin NOT NULL, + UNIQUE KEY `account_details` (accountType, accountDomain, accountID) +)ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index bdb101f4dc..51bebd6e22 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -1282,7 +1282,7 @@ celerity_register_resource_map(array( ), 'javelin-behavior-conpherence-menu' => array( - 'uri' => '/res/89c92cc0/rsrc/js/application/conpherence/behavior-menu.js', + 'uri' => '/res/00da05a6/rsrc/js/application/conpherence/behavior-menu.js', 'type' => 'js', 'requires' => array( diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 0329f69ee3..973dfd02ad 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -922,6 +922,7 @@ phutil_register_library_map(array( 'PhabricatorEventType' => 'infrastructure/events/constant/PhabricatorEventType.php', 'PhabricatorExampleEventListener' => 'infrastructure/events/PhabricatorExampleEventListener.php', 'PhabricatorExtendingPhabricatorConfigOptions' => 'applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php', + 'PhabricatorExternalAccount' => 'applications/people/storage/PhabricatorExternalAccount.php', 'PhabricatorFacebookConfigOptions' => 'applications/config/option/PhabricatorFacebookConfigOptions.php', 'PhabricatorFactAggregate' => 'applications/fact/storage/PhabricatorFactAggregate.php', 'PhabricatorFactChartController' => 'applications/fact/controller/PhabricatorFactChartController.php', @@ -2631,6 +2632,7 @@ phutil_register_library_map(array( 'PhabricatorEventType' => 'PhutilEventType', 'PhabricatorExampleEventListener' => 'PhutilEventListener', 'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions', + 'PhabricatorExternalAccount' => 'PhabricatorUserDAO', 'PhabricatorFacebookConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorFactAggregate' => 'PhabricatorFactDAO', 'PhabricatorFactChartController' => 'PhabricatorFactController', diff --git a/src/applications/people/storage/PhabricatorExternalAccount.php b/src/applications/people/storage/PhabricatorExternalAccount.php new file mode 100644 index 0000000000..486197aed6 --- /dev/null +++ b/src/applications/people/storage/PhabricatorExternalAccount.php @@ -0,0 +1,17 @@ + 'php', 'name' => $this->getPatchPath('20130409.commitdrev.php'), ), + '20130417.externalaccount.sql' => array( + 'type' => 'sql', + 'name' => $this->getPatchPath('20130417.externalaccount.sql'), + ), ); } }