From 4bb94be4f21b10a30bb27a4401dc37d743e26e16 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sat, 21 Mar 2015 22:55:21 -0700 Subject: [PATCH] CRM-16173 - xml/schema/Cxn - Schema + upgrade for storing connections --- .gitignore | 1 + CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl | 23 ++++ xml/schema/Cxn/Cxn.xml | 111 ++++++++++++++++++++ xml/schema/Cxn/files.xml | 5 + xml/schema/Schema.xml | 1 + 5 files changed, 141 insertions(+) create mode 100644 xml/schema/Cxn/Cxn.xml create mode 100644 xml/schema/Cxn/files.xml diff --git a/.gitignore b/.gitignore index 2b816aa5a0..a4646d8781 100644 --- a/.gitignore +++ b/.gitignore @@ -93,6 +93,7 @@ CRM/Core/DAO/Website.php CRM/Core/DAO/WordReplacement.php CRM/Core/DAO/Worldregion.php CRM/Core/I18n/SchemaStructure.php +CRM/Cxn/DAO CRM/Dedupe/DAO CRM/Event/Cart/DAO CRM/Event/DAO diff --git a/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl index 32f4a6952d..dff020fd35 100644 --- a/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl +++ b/CRM/Upgrade/Incremental/sql/4.6.5.mysql.tpl @@ -1,4 +1,27 @@ {* file to handle db changes in 4.6.5 during upgrade *} + +-- CRM-16173 +CREATE TABLE `civicrm_cxn` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Connection ID', + `app_guid` varchar(128) COMMENT 'Application GUID', + `app_meta` text COMMENT 'Application Metadata (JSON)', + `cxn_guid` varchar(128) COMMENT 'Connection GUID', + `secret` text COMMENT 'Shared secret', + `perm` text COMMENT 'Permissions approved for the service (JSON)', + `options` text COMMENT 'Options for the service (JSON)', + `is_active` tinyint DEFAULT 1 COMMENT 'Is connection currently enabled?', + `created_date` timestamp NULL DEFAULT NULL COMMENT 'When was the connection was created.', + `modified_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When the connection was created or modified.', + `fetched_date` timestamp NULL DEFAULT NULL COMMENT 'The last time the application metadata was fetched.' , + PRIMARY KEY ( `id` ) + , UNIQUE INDEX `UI_appid`( + app_guid + ) + , UNIQUE INDEX `UI_keypair_cxnid`( + cxn_guid + ) +) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ; + -- CRM-16417 add failed payment activity type SELECT @option_group_id_act := max(id) from civicrm_option_group where name = 'activity_type'; SELECT @option_group_id_act_wt := MAX(weight) FROM civicrm_option_value WHERE option_group_id = @option_group_id_act; diff --git a/xml/schema/Cxn/Cxn.xml b/xml/schema/Cxn/Cxn.xml new file mode 100644 index 0000000000..8d945de402 --- /dev/null +++ b/xml/schema/Cxn/Cxn.xml @@ -0,0 +1,111 @@ + + CRM/Cxn + Cxn + civicrm_cxn + 4.6 + + id + int unsigned + true + Connection ID + 4.6 + + + id + false + + + + + + app_id + Application GUID + varchar + 128 + Application GUID + 4.6 + + + UI_appid + app_id + true + 4.6 + + + app_meta + Application Metadata (JSON) + text + Application Metadata (JSON) + 4.6 + + + + + + cxn_id + Connection GUID + varchar + 128 + Connection GUID + 4.6 + + + UI_keypair_cxnid + cxn_id + true + 4.6 + + + secret + text + Shared secret + 4.6 + + + perm + text + Permissions approved for the service (JSON) + 4.6 + + + options + text + Options for the service (JSON) + 4.6 + + + + + + is_active + Is Active + boolean + 1 + Is connection currently enabled? + 4.6 + + + created_date + timestamp + When was the connection was created. + false + NULL + 4.6 + + + modified_date + timestamp + When the connection was created or modified. + false + CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + 4.6 + + + fetched_date + timestamp + The last time the application metadata was fetched. + false + NULL + 4.6 + +
diff --git a/xml/schema/Cxn/files.xml b/xml/schema/Cxn/files.xml new file mode 100644 index 0000000000..d11fb7d298 --- /dev/null +++ b/xml/schema/Cxn/files.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/xml/schema/Schema.xml b/xml/schema/Schema.xml index d9af1181be..19def883b4 100644 --- a/xml/schema/Schema.xml +++ b/xml/schema/Schema.xml @@ -30,4 +30,5 @@ + -- 2.25.1