-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecurly.install
116 lines (107 loc) · 3.05 KB
/
recurly.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* Implements hook_schema().
*/
function recurly_schema() {
$schema = array();
$schema['recurly_account'] = array(
'description' => 'Recurly account information mapped to Drupal users.',
'fields' => array(
'account_code' => array(
'description' => 'The unique identifier of the account in Recurly.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'email' => array(
'description' => 'The e-mail address associated with the account in Recurly.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'first_name' => array(
'description' => 'The first name of the account holder.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'last_name' => array(
'description' => 'The last name of the account holder.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'company_name' => array(
'description' => 'The company name associated with the account.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'status' => array(
'description' => 'Whether the account is closed or active.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'uid' => array(
'description' => 'The {users}.uid that maps to this account.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'updated' => array(
'description' => 'The Unix timestamp when the account information was last updated.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'data' => array(
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
'description' => 'A serialized array of additional data.',
),
),
'primary key' => array('account_code'),
'indexes' => array(
'uid' => array('uid'),
),
'foreign keys' => array(
'user' => array(
'table' => 'users',
'columns' => array('uid' => 'uid'),
),
),
);
return $schema;
}
/**
* Implements hook_install().
*/
function recurly_install() {
drupal_install_schema('recurly');
// Initialize the Recurly listener key variable.
variable_set('recurly_listener_key', substr(md5(REQUEST_TIME), 0, 8));
}
/**
* Implements hook_uninstall().
*/
function recurly_uninstall() {
drupal_uninstall_schema('recurly');
// Remove the site-wide account settings.
variable_del('recurly_subdomain');
variable_del('recurly_api_key');
variable_del('recurly_private_key');
// Remove the push notification settings.
variable_del('recurly_listener_key');
variable_del('recurly_push_logging');
// Remove the integration options settings.
variable_del('recurly_account_integration');
}