1 -- +--------------------------------------------------------------------+
2 -- | Copyright CiviCRM LLC. All rights reserved. |
4 -- | This work is published under the GNU AGPLv3 license with some |
5 -- | permitted exceptions and without any warranty. For full license |
6 -- | and copyright information, see https://civicrm.org/licensing |
7 -- +--------------------------------------------------------------------+
9 -- Generated from schema.tpl
10 -- DO NOT EDIT. Generated by CRM_Core_CodeGen
14 -- +--------------------------------------------------------------------+
15 -- | Copyright CiviCRM LLC. All rights reserved. |
17 -- | This work is published under the GNU AGPLv3 license with some |
18 -- | permitted exceptions and without any warranty. For full license |
19 -- | and copyright information, see https://civicrm.org/licensing |
20 -- +--------------------------------------------------------------------+
22 -- Generated from drop.tpl
23 -- DO NOT EDIT. Generated by CRM_Core_CodeGen
25 -- /*******************************************************
27 -- * Clean up the exisiting tables
29 -- *******************************************************/
31 SET FOREIGN_KEY_CHECKS
=0;
33 DROP TABLE IF EXISTS `civicrm_oauth_systoken`
;
34 DROP TABLE IF EXISTS `civicrm_oauth_client`
;
36 SET FOREIGN_KEY_CHECKS
=1;
37 -- /*******************************************************
39 -- * Create new tables
41 -- *******************************************************/
43 -- /*******************************************************
45 -- * civicrm_oauth_client
47 -- *******************************************************/
48 CREATE TABLE `civicrm_oauth_client`
(
51 `
id`
int unsigned AUTO_INCREMENT
COMMENT 'Internal Client ID',
52 `provider`
varchar(128) NOT NULL COMMENT 'Provider',
53 `guid`
varchar(128) NOT NULL COMMENT 'Client ID',
54 `secret`
text COMMENT 'Client Secret',
55 `
options`
text COMMENT 'Extra override options for the service (JSON)',
56 `is_active` tinyint
NOT NULL DEFAULT 1 COMMENT 'Is the client currently enabled?',
57 `created_date`
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When the client was created.',
58 `modified_date`
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When the client was created or modified.'
62 , INDEX `UI_provider`
(
72 -- /*******************************************************
74 -- * civicrm_oauth_systoken
76 -- *******************************************************/
77 CREATE TABLE `civicrm_oauth_systoken`
(
80 `
id`
int unsigned
NOT NULL AUTO_INCREMENT
COMMENT 'Token ID',
81 `tag`
varchar(128) COMMENT 'The tag specifies how this token will be used.',
82 `client_id`
int unsigned
COMMENT 'Client ID',
83 `grant_type`
varchar(31) COMMENT 'Ex: authorization_code',
84 `scopes`
text COMMENT 'List of scopes addressed by this token',
85 `token_type`
varchar(128) COMMENT 'Ex: Bearer or MAC',
86 `access_token`
text COMMENT 'Token to present when accessing resources',
87 `expires`
int unsigned
DEFAULT 0 COMMENT 'Expiration time for the access_token (seconds since epoch)',
88 `refresh_token`
text COMMENT 'Token to present when refreshing the access_token',
89 `resource_owner_name`
varchar(128) COMMENT 'Identifier for the resource owner. Structure varies by service.',
90 `resource_owner`
text COMMENT 'Cached details describing the resource owner',
91 `error`
text COMMENT 'List of scopes addressed by this token',
92 `
raw`
text COMMENT 'The token response data, per AccessToken::jsonSerialize',
93 `created_date`
timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When the client was created.',
94 `modified_date`
timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When the client was created or modified.'
102 , CONSTRAINT FK_civicrm_oauth_systoken_client_id
FOREIGN KEY (`client_id`
) REFERENCES `civicrm_oauth_client`
(`
id`
) ON DELETE CASCADE