-
Notifications
You must be signed in to change notification settings - Fork 4
/
rules.install
121 lines (115 loc) · 3.31 KB
/
rules.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
117
118
119
120
121
<?php
// $Id$
/**
* @file Rules - Installation file.
*/
/**
* Implementation of hook_install().
*/
function rules_install() {
module_load_include('inc', 'rules', 'modules/events');
// Set the modules' weight to 20, see
// http://drupal.org/node/445084#comment-1533280 for the reasoning.
db_query("UPDATE {system} SET weight = 20 WHERE name = 'rules'");
}
/**
* Implementation of hook_uninstall().
*/
function rules_uninstall() {
variable_del('rules_empty_sets');
}
/**
* Implementation of hook_schema().
*/
function rules_schema() {
$schema['rules_config'] = array(
'fields' => array(
'id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'The internal identifier for any configuration.',
),
'name' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'description' => 'The name of the configuration.',
),
'module' => array(
'type' => 'varchar',
'length' => 127,
'not null' => TRUE,
'default' => 'rules',
'description' => 'The module that provides the configuration.',
),
'label' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'description' => 'The label of the configuration.',
'default' => 'unlabeled',
),
'plugin' => array(
'type' => 'varchar',
'length' => 127,
'not null' => TRUE,
'description' => 'The name of the plugin of this configuration.',
),
'active' => array(
'description' => 'Boolean indicating whether the configuration is active. Usage depends on how the using module makes use of it.',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
),
'weight' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Weight of the configuration. Usage depends on how the using module makes use of it.',
),
'data' => array(
'type' => 'blob',
'size' => 'big',
'not null' => FALSE,
'serialize' => TRUE,
'description' => 'Everything else, serialized.',
),
),
'primary key' => array('id'),
'unique keys' => array(
'name' => array('name'),
),
);
$schema['rules_trigger'] = array(
'fields' => array(
'id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The primary identifier of the configuration.',
),
'event' => array(
'type' => 'varchar',
'length' => '127',
'not null' => TRUE,
'default' => '',
'description' => 'The name of the event on which the configuration should be triggered.',
),
),
'primary key' => array('id', 'event'),
'foreign keys' => array(
'id' => array('rules_config' => 'id'),
),
);
$schema['cache_rules'] = drupal_get_schema_unprocessed('system', 'cache');
$schema['cache_rules']['description'] = 'Cache table for the rules engine to store configured items.';
return $schema;
}
/**
* The rules.module has been moved up in the main module directory.
*/
function rules_update_7001() {
// This empty update is required such that all caches are cleared as
// necessary.
}