From 2fad8ce67709bcbbc8cfc63c06241650cd65564b Mon Sep 17 00:00:00 2001 From: lkassianik Date: Mon, 27 Apr 2015 16:35:55 -0700 Subject: [PATCH] Create Edge tables in phabricator_calendar db. Summary: Closes T7945, phabricator_calendar db should now have Edge tables. Test Plan: Use phabricator_calendar db in mysql, show create table edge, verify edge tables are present. Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7945 Differential Revision: https://secure.phabricator.com/D12584 --- .../sql/autopatches/20150427.calendar.1.edge.sql | 16 ++++++++++++++++ src/__phutil_library_map__.php | 2 ++ .../storage/PhabricatorCalendarSchemaSpec.php | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 resources/sql/autopatches/20150427.calendar.1.edge.sql create mode 100644 src/applications/calendar/storage/PhabricatorCalendarSchemaSpec.php diff --git a/resources/sql/autopatches/20150427.calendar.1.edge.sql b/resources/sql/autopatches/20150427.calendar.1.edge.sql new file mode 100644 index 0000000000..3c608e89db --- /dev/null +++ b/resources/sql/autopatches/20150427.calendar.1.edge.sql @@ -0,0 +1,16 @@ +CREATE TABLE {$NAMESPACE}_calendar.edge ( + src VARBINARY(64) NOT NULL, + type INT UNSIGNED NOT NULL, + dst VARBINARY(64) NOT NULL, + dateCreated INT UNSIGNED NOT NULL, + seq INT UNSIGNED NOT NULL, + dataID INT UNSIGNED, + PRIMARY KEY (src, type, dst), + KEY `src` (src, type, dateCreated, seq), + UNIQUE KEY `key_dst` (dst, type, src) +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; + +CREATE TABLE {$NAMESPACE}_calendar.edgedata ( + id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT, + data LONGTEXT NOT NULL COLLATE {$COLLATE_TEXT} +) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT}; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 17b51f75b4..e224503f72 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1493,6 +1493,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarHoliday' => 'applications/calendar/storage/PhabricatorCalendarHoliday.php', 'PhabricatorCalendarHolidayTestCase' => 'applications/calendar/storage/__tests__/PhabricatorCalendarHolidayTestCase.php', 'PhabricatorCalendarRemarkupRule' => 'applications/calendar/remarkup/PhabricatorCalendarRemarkupRule.php', + 'PhabricatorCalendarSchemaSpec' => 'applications/calendar/storage/PhabricatorCalendarSchemaSpec.php', 'PhabricatorCalendarViewController' => 'applications/calendar/controller/PhabricatorCalendarViewController.php', 'PhabricatorCampfireProtocolAdapter' => 'infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php', 'PhabricatorCelerityApplication' => 'applications/celerity/application/PhabricatorCelerityApplication.php', @@ -4813,6 +4814,7 @@ phutil_register_library_map(array( 'PhabricatorCalendarHoliday' => 'PhabricatorCalendarDAO', 'PhabricatorCalendarHolidayTestCase' => 'PhabricatorTestCase', 'PhabricatorCalendarRemarkupRule' => 'PhabricatorObjectRemarkupRule', + 'PhabricatorCalendarSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorCalendarViewController' => 'PhabricatorCalendarController', 'PhabricatorCampfireProtocolAdapter' => 'PhabricatorBotBaseStreamingProtocolAdapter', 'PhabricatorCelerityApplication' => 'PhabricatorApplication', diff --git a/src/applications/calendar/storage/PhabricatorCalendarSchemaSpec.php b/src/applications/calendar/storage/PhabricatorCalendarSchemaSpec.php new file mode 100644 index 0000000000..80c2c75c13 --- /dev/null +++ b/src/applications/calendar/storage/PhabricatorCalendarSchemaSpec.php @@ -0,0 +1,10 @@ +buildEdgeSchemata(new PhabricatorCalendarEvent()); + } + +}