You are here

function book_copy_schema in Book Copy 7

Same name and namespace in other branches
  1. 6 book_copy.install \book_copy_schema()

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.

File

./book_copy.install, line 24
Install, update and uninstall functions for the book_copy module.

Code

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;
}