View source
<?php
function context_node_schema() {
$schema = array();
$schema['context_node'] = array(
'description' => 'Custom layout context node table.',
'fields' => array(
'nid' => array(
'description' => 'Node nid number',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'vid' => array(
'description' => 'Node vid number',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'context' => array(
'description' => 'Node template',
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
),
),
'unique keys' => array(
'vid' => array(
'vid',
),
),
'primary key' => array(
'vid',
),
);
return $schema;
}
function context_node_install() {
}
function context_node_uninstall() {
$types = array_keys(node_type_get_types());
foreach ($types as $type) {
variable_del("context_node_" . $type);
variable_del("context_node_default_" . $type);
}
}
function context_node_update_7100() {
$ret = array();
db_add_unique_key('context_node', 'vid', array(
'vid',
));
db_add_primary_key('context_node', array(
'vid',
));
return $ret;
}