nodehierarchy_views.install in Node Hierarchy 6.2
Install file for nodehierarchy_views module.
File
nodehierarchy_views/nodehierarchy_views.installView source
<?php
/**
* @file
* Install file for nodehierarchy_views module.
*/
// Create the database table on install (MySQL only for now)
function nodehierarchy_views_install() {
drupal_install_schema('nodehierarchy_views');
}
function nodehierarchy_views_uninstall() {
drupal_uninstall_schema('nodehierarchy_views');
}
function nodehierarchy_views_update_6200() {
$ret = array();
// Add more length to the field name to accomodate the
db_add_field($ret, 'nodehierarchy_views', 'nh_children_view_display', array(
'type' => 'varchar',
'length' => '64',
'default' => 'default',
'not null' => TRUE,
'description' => t('The {views_display}.id of the embedded view.'),
));
return $ret;
}
/**
* Implementation of hook_schema().
*/
function nodehierarchy_views_schema() {
$schema['nodehierarchy_views'] = array(
'fields' => array(
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('The {node}.nid whose children are being embedded.'),
),
'nh_children_view' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
'not null' => TRUE,
'description' => t('The {views_view}.name of the embedded view.'),
),
'nh_children_view_display' => array(
'type' => 'varchar',
'length' => '64',
'default' => 'default',
'not null' => TRUE,
'description' => t('The {views_display}.id of the embedded view.'),
),
),
'primary key' => array(
'nid',
),
);
return $schema;
}
Functions
Name | Description |
---|---|
nodehierarchy_views_install | |
nodehierarchy_views_schema | Implementation of hook_schema(). |
nodehierarchy_views_uninstall | |
nodehierarchy_views_update_6200 |