-
Notifications
You must be signed in to change notification settings - Fork 1
/
hosting_git.install
75 lines (70 loc) · 1.94 KB
/
hosting_git.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
<?php
/**
* @file
* Install, update and uninstall functions for the hosting_git module.
*/
/**
* Implements hook_schema().
*/
function hosting_git_schema() {
$schema = array();
$schema['hosting_git'] = array(
'description' => 'A mapping between platform or site node IDs and Git data',
'fields' => array(
'nid' => array(
'description' => 'The platform or site nid from the {node} table.',
'type' => 'int',
'not null' => TRUE,
),
'repo_url' => array(
'description' => 'The URL given to the git repository',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'repo_path' => array(
'description' => 'The absolute path to clone the repository to.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
'repo_docroot' => array(
'description' => 'The relative path within the git repository where sites will be hosted.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
'git_ref' => array(
'description' => 'The current git branch or tag.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('nid'),
);
return $schema;
}
/**
* Add repo_path and repo_docroot fields.
*/
function hosting_git_update_7301 () {
db_add_field('hosting_git', 'repo_path', array(
'description' => 'The absolute path to clone the repository to.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
));
db_add_field('hosting_git', 'repo_docroot', array(
'description' => 'The (relative) path within a git repository where sites will be hosted.',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
));
}