Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / book / book.install
1 <?php
2
3 /**
4  * @file
5  * Install, update and uninstall functions for the book module.
6  */
7
8 /**
9  * Implements hook_uninstall().
10  */
11 function book_uninstall() {
12   // Clear book data out of the cache.
13   \Drupal::cache('data')->deleteAll();
14 }
15
16 /**
17  * Implements hook_schema().
18  */
19 function book_schema() {
20   $schema['book'] = [
21   'description' => 'Stores book outline information. Uniquely defines the location of each node in the book outline',
22     'fields' => [
23       'nid' => [
24         'type' => 'int',
25         'unsigned' => TRUE,
26         'not null' => TRUE,
27         'default' => 0,
28         'description' => "The book page's {node}.nid.",
29       ],
30       'bid' => [
31         'type' => 'int',
32         'unsigned' => TRUE,
33         'not null' => TRUE,
34         'default' => 0,
35         'description' => "The book ID is the {book}.nid of the top-level page.",
36       ],
37       'pid' => [
38         '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.',
39         'type' => 'int',
40         'unsigned' => TRUE,
41         'not null' => TRUE,
42         'default' => 0,
43       ],
44       'has_children' => [
45         'description' => 'Flag indicating whether any nodes have this node as a parent (1 = children exist, 0 = no children).',
46         'type' => 'int',
47         'not null' => TRUE,
48         'default' => 0,
49         'size' => 'small',
50       ],
51       'weight' => [
52         'description' => 'Weight among book entries in the same book at the same depth.',
53         'type' => 'int',
54         'not null' => TRUE,
55         'default' => 0,
56       ],
57       'depth' => [
58         'description' => 'The depth relative to the top level. A link with pid == 0 will have depth == 1.',
59         'type' => 'int',
60         'not null' => TRUE,
61         'default' => 0,
62         'size' => 'small',
63       ],
64       'p1' => [
65         '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.',
66         'type' => 'int',
67         'unsigned' => TRUE,
68         'not null' => TRUE,
69         'default' => 0,
70       ],
71       'p2' => [
72         'description' => 'The second nid in the materialized path. See p1.',
73         'type' => 'int',
74         'unsigned' => TRUE,
75         'not null' => TRUE,
76         'default' => 0,
77       ],
78       'p3' => [
79         'description' => 'The third nid in the materialized path. See p1.',
80         'type' => 'int',
81         'unsigned' => TRUE,
82         'not null' => TRUE,
83         'default' => 0,
84       ],
85       'p4' => [
86         'description' => 'The fourth nid in the materialized path. See p1.',
87         'type' => 'int',
88         'unsigned' => TRUE,
89         'not null' => TRUE,
90         'default' => 0,
91       ],
92       'p5' => [
93         'description' => 'The fifth nid in the materialized path. See p1.',
94         'type' => 'int',
95         'unsigned' => TRUE,
96         'not null' => TRUE,
97         'default' => 0,
98       ],
99       'p6' => [
100         'description' => 'The sixth nid in the materialized path. See p1.',
101         'type' => 'int',
102         'unsigned' => TRUE,
103         'not null' => TRUE,
104         'default' => 0,
105       ],
106       'p7' => [
107         'description' => 'The seventh nid in the materialized path. See p1.',
108         'type' => 'int',
109         'unsigned' => TRUE,
110         'not null' => TRUE,
111         'default' => 0,
112       ],
113       'p8' => [
114         'description' => 'The eighth nid in the materialized path. See p1.',
115         'type' => 'int',
116         'unsigned' => TRUE,
117         'not null' => TRUE,
118         'default' => 0,
119       ],
120       'p9' => [
121         'description' => 'The ninth nid in the materialized path. See p1.',
122         'type' => 'int',
123         'unsigned' => TRUE,
124         'not null' => TRUE,
125         'default' => 0,
126       ],
127     ],
128     'primary key' => ['nid'],
129     'indexes' => [
130       'book_parents' => ['bid', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'],
131     ],
132   ];
133
134   return $schema;
135 }