forked from ding2/ding_campaign
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathding_campaign.install
More file actions
97 lines (91 loc) · 2.07 KB
/
ding_campaign.install
File metadata and controls
97 lines (91 loc) · 2.07 KB
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
<?php
/**
* @file
* Install, update and uninstall functions for the ding_campaign module.
*/
/**
* Implements hook_schema().
*/
function ding_campaign_schema() {
$schema['ding_campaign'] = array(
'description' => 'Table holding campaign types types for easier access',
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'cid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'type' => array(
'type' => 'varchar',
'length' => 128,
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('id'),
'indexes' => array(
'cid' => array('cid'),
'weight' => array('weight'),
),
);
$schema['ding_campaign_rules'] = array(
'description' => 'Table for ding campaigns usage',
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
),
'cid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'rule' => array(
'type' => 'varchar',
'length' => 128,
),
'type' => array(
'type' => 'varchar',
'length' => 128,
),
),
'primary key' => array('id'),
'indexes' => array(
'nid' => array('nid'),
'cid' => array('cid'),
'rule' => array('rule'),
'type' => array('type'),
),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function ding_campaign_uninstall() {
variable_del('ding_campaign_node_types');
drupal_uninstall_schema('ding_campaign');
}
/**
* Implements hook_update_N().
* Remove column 'theme' from table 'ding_campaign'
*/
function ding_campaign_update_7001(&$sandbox) {
return db_drop_field('ding_campaign','theme');
}