-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathshrtr.install
More file actions
66 lines (65 loc) · 1.54 KB
/
shrtr.install
File metadata and controls
66 lines (65 loc) · 1.54 KB
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
<?php
/**
* Implements hook_schema().
*/
function shrtr_schema() {
$schema['shrtr_urls'] = array(
'description' => 'Shortened URLs',
'fields' => array(
'id' => array(
'description' => 'ID of shortened URL',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'url' => array(
'description' => 'Original URL',
'type' => 'text',
'not null' => TRUE,
'size' => 'small',
),
'created' => array(
'description' => 'Created',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'uid' => array(
'description' => 'User ID',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'expire' => array(
'description' => 'Expire time',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
),
'alias' => array(
'description' => 'The alias of the shortened URL',
'type' => 'text',
'not null' => TRUE,
'length' => 256,
),
'enabled' => array(
'description' => 'Enabled',
'type' => 'int',
'not null' => TRUE,
'default' => 1,
'length' => 1,
),
),
'primary key' => array('id'),
'unique keys' => array(
'alias' => array(array('alias', 32)),
),
'indexes' => array(
'created' => array('created'),
'uid' => array('uid'),
'expire' => array('expire'),
'enabled' => array('enabled'),
),
);
return $schema;
}