-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclone.install
94 lines (90 loc) · 2.3 KB
/
clone.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
<?php
/**
* Implements hook_install()
*/
function clone_install() {
watchdog('Clone', 'installing');
if (!db_table_exists('clone_requests')) {
drupal_install_schema('clone');
watchdog('Clone', 'table clone_requests created');
}
}
/**
* Implements hook_uninstall()
*/
function clone_uninstall() {
if (db_table_exists('clone_requests')) {
drupal_uninstall_schema('clone');
watchdog('Clone', 'table clone_requests dropped');
}
watchdog('Clone', 'uninstalling');
}
/**
* Implements hook_schema()
*/
function clone_schema() {
watchdog('Clone', 'schema');
$schema['clone_requests'] = array(
'description' => 'Stores clone requests.',
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => 'true',
'not null' => TRUE,
'description' => 'primary identifier',
),
'url' => array(
'type' => 'varchar',
'length' => 256,
'default' => '',
'description' => 'URL (of the drupal instance) the request has been sent from.',
),
'ip' => array(
'type' => 'varchar',
'length' => 256,
'default' => '',
'description' => 'IP of the entity making the request.',
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Unix timestamp when request was made',
),
'name' => array(
'type' => 'varchar',
'length' => 256,
'not null' => TRUE,
'default' => '',
'description' => 'Name of the pattern.',
),
'title' => array(
'type' => 'varchar',
'length' => 256,
'not null' => TRUE,
'default' => '',
'description' => 'Title of the pattern.',
),
'version' => array(
'type' => 'varchar',
'length' => 256,
'not null' => FALSE,
'default' => NULL,
'description' => 'Version of the pattern.',
),
'format' => array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => 'yaml',
'description' => 'Format of the pattern.',
),
'content' => array(
'type' => 'blob',
'description' => 'Content of the pattern.',
),
),
'primary key' => array('id'),
);
return $schema;
}