-
Notifications
You must be signed in to change notification settings - Fork 5
/
artwork.install
100 lines (96 loc) · 2.64 KB
/
artwork.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
99
100
<?php
function artwork_schema() {
$schema['artwork'] = array(
'description' => 'The base table for artworks.',
'fields' => array(
'aid' => array(
'description' => 'The primary identifier for an artwork.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'vid' => array(
'description' => 'The current {artwork_revision}.vid version identifier.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'type' => array(
'description' => 'The {artwork_type} of this artwork.',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'title' => array(
'description' => 'The title of this artwork.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'created' => array(
'description' => 'The Unix timestamp when the artwork was created.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'changed' => array(
'description' => 'The Unix timestamp when the artwork was most recently saved.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'unique keys' => array(
'aid_vid' => array('aid', 'vid'),
'aid' => array('aid')
),
'primary key' => array('aid'),
);
$schema['artwork_revision'] = array(
'description' => 'Stores information about each saved version of an {artwork}.',
'fields' => array(
'aid' => array(
'description' => 'The {artwork} this version belongs to.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'vid' => array(
'description' => 'The primary identifier for this version.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'title' => array(
'description' => 'The title of this version.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'created' => array(
'description' => 'The Unix timestamp when the artwork was created.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'aid' => array('aid'),
),
'primary key' => array('vid'),
'foreign keys' => array(
'artwork' => array(
'table' => 'artwork',
'columns' => array(
'aid' => 'aid',
),
),
),
);
return $schema;
}