summaryrefslogtreecommitdiffstats
path: root/panels.install
blob: 4116e93b734e1a589683044da3a33991e7a49437 (plain)
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?php
// $Id$

/**
 * Implementation of hook_schema().
 */
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')
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function panels_install() {
  db_query("UPDATE {system} SET weight = 10 WHERE name = 'panels'");
  drupal_install_schema('panels');
}

/**
 * Implementation of hook_uninstall().
 */
function panels_uninstall() {
  drupal_uninstall_schema('panels');
}