View source
<?php
function viewreference_install() {
drupal_install_schema('viewreference');
content_notify('install', 'viewreference');
}
function viewreference_uninstall() {
drupal_uninstall_schema('viewreference');
content_notify('uninstall', 'viewreference');
}
function viewreference_enable() {
content_notify('enable', 'viewreference');
}
function viewreference_disable() {
content_notify('disable', 'viewreference');
}
function viewreference_schema() {
$schema['viewreference'] = array(
'fields' => array(
'view_id' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'name' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
'not null' => TRUE,
),
'position' => array(
'type' => 'varchar',
'length' => '64',
'default' => '',
'not null' => TRUE,
),
'title' => array(
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array(
'view_id',
),
);
return $schema;
}
function viewreference_update_6212() {
$ret = array();
db_drop_primary_key($ret, 'viewreference');
db_change_field($ret, 'viewreference', 'view_id', 'view_id', array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
'default' => 0,
), array(
'primary key' => array(
'view_id',
),
));
return $ret;
}