-
Notifications
You must be signed in to change notification settings - Fork 10
/
project.install
82 lines (77 loc) · 1.99 KB
/
project.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
<?php
/**
* @file
* Install, update, and uninstall functions for the Project module.
*/
/**
* Implements hook_install().
*/
function project_install() {
$node_type = array(
'type' => 'project',
'name' => st('Project'),
'description' => st('A project contains code-related assets.'),
'settings' => array(
'status_default' => TRUE,
'promote_enabled' => FALSE,
'promote_default' => FALSE,
'sticky_enabled' => FALSE,
'sticky_default' => FALSE,
'revision_enabled' => FALSE,
'revision_default' => FALSE,
'show_submitted_info' => FALSE,
'project_behavior' => 'project',
),
'base' => 'node_content',
'module' => 'project',
'is_new' => TRUE,
);
$node_type = node_type_set_defaults($node_type);
if (module_exists('comment')) {
$node_type->settings['comment_default'] = COMMENT_NODE_CLOSED;
}
node_add_body_field($node_type, st('Description'));
node_type_save($node_type);
}
/**
* Implements hook_schema().
*/
function project_schema() {
$schema['project'] = array(
'description' => 'Stores project-specific node data.',
'fields' => array(
'nid' => array(
'description' => 'Foreign key: node.nid of the project.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'name' => array(
'description' => 'The project machine name.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'sandbox' => array(
'description' => 'Is this project a non-validated, non-unique sandbox project?',
'type' => 'int',
'size' => 'tiny',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array('nid'),
'indexes' => array(
'name_sandbox' => array('name', 'sandbox'),
),
);
return $schema;
}
/**
* Implements hook_update_last_removed().
*/
function project_update_last_removed() {
return 7007;
}