Chris@0: deleteAll(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Implements hook_schema(). Chris@0: */ Chris@0: function book_schema() { Chris@0: $schema['book'] = [ Chris@0: 'description' => 'Stores book outline information. Uniquely defines the location of each node in the book outline', Chris@0: 'fields' => [ Chris@0: 'nid' => [ Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: 'description' => "The book page's {node}.nid.", Chris@0: ], Chris@0: 'bid' => [ Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: 'description' => "The book ID is the {book}.nid of the top-level page.", Chris@0: ], Chris@0: 'pid' => [ Chris@0: 'description' => 'The parent ID (pid) is the id of the node above in the hierarchy, or zero if the node is at the top level in its outline.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'has_children' => [ Chris@0: 'description' => 'Flag indicating whether any nodes have this node as a parent (1 = children exist, 0 = no children).', Chris@0: 'type' => 'int', Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: 'size' => 'small', Chris@0: ], Chris@0: 'weight' => [ Chris@0: 'description' => 'Weight among book entries in the same book at the same depth.', Chris@0: 'type' => 'int', Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'depth' => [ Chris@0: 'description' => 'The depth relative to the top level. A link with pid == 0 will have depth == 1.', Chris@0: 'type' => 'int', Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: 'size' => 'small', Chris@0: ], Chris@0: 'p1' => [ Chris@0: 'description' => 'The first nid in the materialized path. If N = depth, then pN must equal the nid. If depth > 1 then p(N-1) must equal the pid. All pX where X > depth must equal zero. The columns p1 .. p9 are also called the parents.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p2' => [ Chris@0: 'description' => 'The second nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p3' => [ Chris@0: 'description' => 'The third nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p4' => [ Chris@0: 'description' => 'The fourth nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p5' => [ Chris@0: 'description' => 'The fifth nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p6' => [ Chris@0: 'description' => 'The sixth nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p7' => [ Chris@0: 'description' => 'The seventh nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p8' => [ Chris@0: 'description' => 'The eighth nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'p9' => [ Chris@0: 'description' => 'The ninth nid in the materialized path. See p1.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: ], Chris@0: 'primary key' => ['nid'], Chris@0: 'indexes' => [ Chris@0: 'book_parents' => ['bid', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'], Chris@0: ], Chris@0: ]; Chris@0: Chris@0: return $schema; Chris@0: }