forked from mlutfy/hosting_civicrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hosting_civicrm.install
68 lines (62 loc) · 1.41 KB
/
hosting_civicrm.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
<?php
/**
* @file
* Add (and remove) a field in the hosting_site table for CiviCRM version.
*/
/**
* Implements hook_schema_alter().
*/
function hosting_civicrm_schema_alter(&$schema) {
// Add civicrm sitekey field to existing schema.
$schema['hosting_site']['fields']['civicrm_sitekey'] = array(
'type' => 'varchar',
'length' => '128',
'not null' => FALSE,
'default' => NULL,
);
}
/**
* Implements hook_install().
*/
function hosting_civicrm_install() {
db_add_field('hosting_site', 'civicrm_sitekey', array(
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
'default' => NULL,
));
}
/**
* Implements hook_uninstall().
*/
function hosting_civicrm_uninstall() {
}
/**
* Implements hook_update_N().
*
* Remove the civicrm_version field from hosting_sites.
*/
function hosting_civicrm_update_7001() {
$ret = array();
if (db_field_exists('hosting_site', 'civicrm_version')) {
$ret[] = db_drop_field('hosting_site', 'civicrm_version');
}
return $ret;
}
/**
* Implements hook_update_N().
*
* Add the civicrm_sitekey field to hosting_sites.
*/
function hosting_civicrm_update_7002() {
$ret = array();
if (! db_field_exists('hosting_site', 'civicrm_sitekey')) {
$ret[] = db_add_field('hosting_site', 'civicrm_sitekey', array(
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
'default' => NULL,
));
}
return $ret;
}