1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* Implementation of hook_schema().
|
5 |
|
|
*/
|
6 |
|
|
function panels_node_schema() {
|
7 |
|
|
// This should always point to our 'current' schema. This makes it relatively easy
|
8 |
|
|
// to keep a record of schema as we make changes to it.
|
9 |
|
|
return panels_node_schema_1();
|
10 |
|
|
}
|
11 |
|
|
|
12 |
|
|
/**
|
13 |
|
|
* Schema version 1 for Panels in D6.
|
14 |
|
|
*/
|
15 |
|
|
function panels_node_schema_1() {
|
16 |
|
|
$schema = array();
|
17 |
|
|
|
18 |
|
|
$schema['panels_node'] = array(
|
19 |
|
|
'fields' => array(
|
20 |
|
|
'nid' => array(
|
21 |
|
|
'type' => 'int',
|
22 |
|
|
'not null' => TRUE,
|
23 |
|
|
'default' => 0,
|
24 |
|
|
),
|
25 |
|
|
'css_id' => array(
|
26 |
|
|
'type' => 'varchar',
|
27 |
|
|
'length' => '255',
|
28 |
|
|
),
|
29 |
|
|
'did' => array(
|
30 |
|
|
'type' => 'int',
|
31 |
|
|
'not null' => TRUE,
|
32 |
|
|
),
|
33 |
|
|
'pipeline' => array(
|
34 |
|
|
'type' => 'varchar',
|
35 |
|
|
'length' => '255',
|
36 |
|
|
),
|
37 |
|
|
),
|
38 |
|
|
'primary key' => array('did'),
|
39 |
|
|
);
|
40 |
|
|
|
41 |
|
|
return $schema;
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
/**
|
45 |
|
|
* Implementation of hook_install().
|
46 |
|
|
*/
|
47 |
|
|
function panels_node_install() {
|
48 |
|
|
db_query("UPDATE {system} SET weight = 11 WHERE name = 'panels_node'");
|
49 |
|
|
}
|
50 |
|
|
|
51 |
|
|
/**
|
52 |
|
|
* Implementation of hook_uninstall().
|
53 |
|
|
*/
|
54 |
|
|
function panels_node_uninstall() {
|
55 |
|
|
db_query("DELETE FROM {node} WHERE type = 'panel'");
|
56 |
|
|
drupal_uninstall_schema('panels_node');
|
57 |
|
|
}
|
58 |
|
|
|
59 |
|
|
/**
|
60 |
|
|
* Implementation of hook_update to handle adding a pipeline
|
61 |
|
|
*/
|
62 |
|
|
function panels_node_update_6001() {
|
63 |
|
|
$ret = array();
|
64 |
|
|
$field = array(
|
65 |
|
|
'type' => 'varchar',
|
66 |
|
|
'length' => '255',
|
67 |
|
|
);
|
68 |
|
|
|
69 |
|
|
db_add_field('panels_node', 'pipeline', $field);
|
70 |
|
|
return $ret;
|
71 |
|
|
} |