Newer
Older
Earl Miles
committed
<?php
// $Id$
/**
Earl Miles
committed
* Implementation of hook_schema().
Earl Miles
committed
*/
Earl Miles
committed
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
122
123
124
125
126
127
128
129
130
131
function panels_schema() {
// This should always point to our 'current' schema. This makes it relatively easy
// to keep a record of schema as we make changes to it.
return panels_schema_1();
}
/**
* Schema version 1 for Panels in D6.
*/
function panels_schema_1() {
$schema = array();
$schema['panels_display'] = array(
'fields' => array(
'did' => array(
'type' => 'serial',
'not null' => TRUE,
),
'layout' => array(
'type' => 'varchar',
'length' => '32',
),
'layout_settings' => array(
'type' => 'text',
'size' => 'big',
),
'panel_settings' => array(
'type' => 'text',
'size' => 'big',
),
'cache' => array(
'type' => 'text',
),
'title' => array(
'type' => 'varchar',
'length' => '255',
),
'hide_title' => array(
'type' => 'int',
'size' => 'tiny',
),
),
'primary key' => array('did'),
);
$schema['panels_pane'] = array(
'fields' => array(
'pid' => array(
'type' => 'serial',
'not null' => TRUE,
),
'did' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'panel' => array(
'type' => 'varchar',
'length' => '32',
),
'type' => array(
'type' => 'varchar',
'length' => '32',
),
'subtype' => array(
'type' => 'varchar',
'length' => '64',
),
'shown' => array(
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
'access' => array(
'type' => 'varchar',
'length' => '128',
),
'visibility' => array(
'type' => 'text',
'size' => 'big',
),
'configuration' => array(
'type' => 'text',
'size' => 'big',
),
'cache' => array(
'type' => 'text',
'size' => 'big',
),
'position' => array(
'type' => 'int',
'size' => 'small',
),
),
'primary key' => array('pid'),
'indexes' => array(
'did_idx' => array('did')
),
);
$schema['panels_object_cache'] = array(
'fields' => array(
'sid' => array(
'type' => 'varchar',
'length' => '64',
),
'did' => array(
'type' => 'int',
),
'obj' => array(
'type' => 'varchar',
'length' => '255',
),
'data' => array(
'type' => 'text',
'size' => 'big',
),
'timestamp' => array(
'type' => 'int',
),
),
'indexes' => array(
'idx' => array('sid', 'obj', 'did'),
'time_idx' => array('timestamp')
),
Earl Miles
committed
);
Earl Miles
committed
return $schema;
}
Earl Miles
committed
Earl Miles
committed
/**
* Implementation of hook_install().
*/
function panels_install() {
db_query("UPDATE {system} SET weight = 10 WHERE name = 'panels'");
drupal_set_message(t('Please keep in mind that this is an Alpha release of Panels for Drupal 6, and is NOT intended for use on production sites.'));
drupal_set_message(t('Additionally, the upgrade path from Drupal 5 has NOT been resolved, and should not be attempted.'));
drupal_set_message(t('Bug reports are encouraged, especially when they come with patches! The !link has details on filing issues.', array('!link' => l('Panels project page', 'http://drupal.org/project/panels'))));
Earl Miles
committed
drupal_install_schema('panels');
}
/**
* Implementation of hook_uninstall().
*/
function panels_uninstall() {
drupal_uninstall_schema('panels');