From e81b2173ad08b7035e5e1a92247c11cca5721ccc Mon Sep 17 00:00:00 2001 From: Austin McKinley Date: Thu, 19 Apr 2018 13:38:37 -0700 Subject: [PATCH] Add edge tables for Phlux Summary: Fixes T13129. This at least makes the existing UI work again before we banish Phlux to the shadow realm. Test Plan: Edited the visibility for a Phlux variable, didn't get an error. Nothing showed up in the edge tables when I made those changes, but at least it doesn't error out anymore. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13129 Differential Revision: https://secure.phabricator.com/D19387 --- .../sql/autopatches/20180419.phlux.edges.sql | 16 ++++++++++++++++ src/__phutil_library_map__.php | 2 ++ .../phlux/storage/PhluxSchemaSpec.php | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 resources/sql/autopatches/20180419.phlux.edges.sql create mode 100644 src/applications/phlux/storage/PhluxSchemaSpec.php diff --git a/resources/sql/autopatches/20180419.phlux.edges.sql b/resources/sql/autopatches/20180419.phlux.edges.sql new file mode 100644 index 0000000000..1a63aa4d1f --- /dev/null +++ b/resources/sql/autopatches/20180419.phlux.edges.sql @@ -0,0 +1,16 @@ +CREATE TABLE {$NAMESPACE}_phlux.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}_phlux.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 9eda923457..5f1543aa91 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -4716,6 +4716,7 @@ phutil_register_library_map(array( 'PhluxDAO' => 'applications/phlux/storage/PhluxDAO.php', 'PhluxEditController' => 'applications/phlux/controller/PhluxEditController.php', 'PhluxListController' => 'applications/phlux/controller/PhluxListController.php', + 'PhluxSchemaSpec' => 'applications/phlux/storage/PhluxSchemaSpec.php', 'PhluxTransaction' => 'applications/phlux/storage/PhluxTransaction.php', 'PhluxTransactionQuery' => 'applications/phlux/query/PhluxTransactionQuery.php', 'PhluxVariable' => 'applications/phlux/storage/PhluxVariable.php', @@ -10693,6 +10694,7 @@ phutil_register_library_map(array( 'PhluxDAO' => 'PhabricatorLiskDAO', 'PhluxEditController' => 'PhluxController', 'PhluxListController' => 'PhluxController', + 'PhluxSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhluxTransaction' => 'PhabricatorApplicationTransaction', 'PhluxTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhluxVariable' => array( diff --git a/src/applications/phlux/storage/PhluxSchemaSpec.php b/src/applications/phlux/storage/PhluxSchemaSpec.php new file mode 100644 index 0000000000..ee8a38b6f5 --- /dev/null +++ b/src/applications/phlux/storage/PhluxSchemaSpec.php @@ -0,0 +1,10 @@ +buildEdgeSchemata(new PhluxVariable()); + } + +}