book_copy.install in Book Copy 7
Same filename and directory in other branches
Install, update and uninstall functions for the book_copy module.
File
book_copy.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the book_copy module.
*
*/
/**
* Implements hook_install().
*/
function book_copy_install() {
db_update('system')
->fields(array(
'weight' => 15,
))
->condition('name', 'book_copy')
->execute();
}
/**
* Implements hook_schema().
*
* An entry in the {book_copy} table indicates that a
* book is to be considered personal, meaning that only the
* owner may add pages to it.
*/
function book_copy_schema() {
$schema['book_copy_history'] = array(
'description' => 'This table maintains source history for books derived via the copy feature',
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The new nid of the node copied',
),
'bid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The target book (when initially copied)',
),
'sbid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The source book',
),
'snid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The source nid.',
),
'copied' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'The datetime this was copied',
),
),
'primary key' => array(
'nid',
),
);
return $schema;
}
Functions
Name![]() |
Description |
---|---|
book_copy_install | Implements hook_install(). |
book_copy_schema | Implements hook_schema(). |