function book_schema

Same name in other branches
  1. 9 core/modules/book/book.install \book_schema()
  2. 8.9.x core/modules/book/book.install \book_schema()
  3. 10 core/modules/book/book.install \book_schema()
  4. 11.x core/modules/book/book.install \book_schema()

Implements hook_schema().

File

modules/book/book.install, line 59

Code

function book_schema() {
    $schema['book'] = array(
        'description' => 'Stores book outline information. Uniquely connects each node in the outline to a link in {menu_links}',
        'fields' => array(
            'mlid' => array(
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
                'description' => "The book page's {menu_links}.mlid.",
            ),
            'nid' => array(
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
                'description' => "The book page's {node}.nid.",
            ),
            'bid' => array(
                'type' => 'int',
                'unsigned' => TRUE,
                'not null' => TRUE,
                'default' => 0,
                'description' => "The book ID is the {book}.nid of the top-level page.",
            ),
        ),
        'primary key' => array(
            'mlid',
        ),
        'unique keys' => array(
            'nid' => array(
                'nid',
            ),
        ),
        'indexes' => array(
            'bid' => array(
                'bid',
            ),
        ),
    );
    return $schema;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.