-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathding_campaign_plus.install
95 lines (87 loc) · 2.02 KB
/
ding_campaign_plus.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
<?php
/**
* @file
* Install, update and uninstall functions for the module.
*/
/**
* Implements hook_schema().
*/
function ding_campaign_plus_schema() {
$schema = array();
$schema['ding_campaign_plus'] = array(
'description' => 'Campaign plus rules',
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'type' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'rule' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
),
'title' => array(
'type' => 'text',
'not null' => FALSE,
),
'value' => array(
'type' => 'text',
'not null' => TRUE,
),
),
'primary key' => array('id'),
'indexes' => array(
'nid' => array('nid'),
),
);
$schema['ding_campaign_plus_auto'] = array(
'description' => 'Linked auto generated campaigns',
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'campaign_nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('id'),
'indexes' => array(
'nid' => array('nid'),
),
);
return $schema;
}
/**
* Implements hook_uninstall().
*/
function ding_campaign_plus_uninstall() {
drupal_uninstall_schema('ding_campaign_plus');
drupal_uninstall_schema('ding_campaign_plus_auto');
variable_del('ding_campaign_plus_weight');
variable_del('ding_campaign_plus_expire');
variable_del('ding_campaign_plus_auto');
variable_del('ding_campaign_plus_cron_last_run');
}