-
Notifications
You must be signed in to change notification settings - Fork 0
/
cyoa.install
98 lines (94 loc) · 2.4 KB
/
cyoa.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
function cyoa_install() {
drupal_install_schema('cyoa');
}
function cyoa_uninstall() {
drupal_uninstall_schema('cyoa');
}
function cyoa_schema() {
$schema['cyoa'] = array(
'description' => 'Stored adventures started.',
'fields' => array(
'cyoaid' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique cyoa ID.',
),
'uid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "User's {users}.uid.",
),
'hostname' => array(
'description' => 'Hostname of the visitor.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => ''
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "Node started on",
),
'timestamp' => array(
'description' => 'Timestamp of the event.',
'type' => 'int',
'not null' => TRUE,
'default' => 0
),
'completed' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny',
'description' => 'Whether the have reached an end.',
),
),
'primary key' => array('cyoaid'),
);
$schema['cyoac'] = array(
'description' => 'Create your own adventure choices.',
'fields' => array(
'cyoacid' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => 'Primary Key: Unique cyoa ID.',
),
'cyoaid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "CYOA id.",
),
'pcyoacid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "Parent/refering adventure.",
),
'delta' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "current path (in case of divergence)",
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => "Node choisen",
),
'timestamp' => array(
'description' => 'Timestamp of the event.',
'type' => 'int',
'not null' => TRUE,
'default' => 0
),
),
'primary key' => array('cyoacid'),
);
return $schema;
}