This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
infinite_base.install
92 lines (76 loc) · 2.76 KB
/
infinite_base.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
<?php
use Drupal\Core\Database\Database;
/**
* Implements hook_install().
*/
function infinite_base_install() {
$spec = array(
'type' => 'int',
'size' => 'tiny',
'description' => 'Promoted to top presenter',
'not null' => FALSE,
'default' => NULL,
);
$schema = Database::getConnection()->schema();
$schema->addField('node_field_data', 'promote_top_presenter', $spec);
$schema->addField('node_field_revision', 'promote_top_presenter', $spec);
$spec = array(
'type' => 'int',
'size' => 'tiny',
'description' => 'Promoted to frontpage presenter',
'not null' => FALSE,
'default' => NULL,
);
$schema = Database::getConnection()->schema();
$schema->addField('node_field_data', 'promote_front_presenter', $spec);
$schema->addField('node_field_revision', 'promote_front_presenter', $spec);
$spec = array(
'type' => 'int',
'size' => 'tiny',
'description' => 'Promoted to channel page',
'not null' => FALSE,
'default' => NULL,
);
$schema = Database::getConnection()->schema();
$schema->addField('node_field_data', 'promote_channel', $spec);
$schema->addField('node_field_revision', 'promote_channel', $spec);
$spec = array(
'type' => 'int',
'size' => 'tiny',
'description' => 'Promoted to channel presenter',
'not null' => FALSE,
'default' => NULL,
);
$schema = Database::getConnection()->schema();
$schema->addField('node_field_data', 'promote_channel_presenter', $spec);
$schema->addField('node_field_revision', 'promote_channel_presenter', $spec);
$spec = array(
'type' => 'int',
'size' => 'tiny',
'description' => 'Mark as sponsored',
'not null' => FALSE,
'default' => NULL,
);
$schema = Database::getConnection()->schema();
$schema->addField('node_field_data', 'sponsored', $spec);
$schema->addField('node_field_revision', 'sponsored', $spec);
}
function infinite_base_uninstall() {
$schema = Database::getConnection()->schema();
$schema->dropField('node_field_data', 'sponsored');
$schema->dropField('node_field_revision', 'sponsored');
$schema->dropField('node_field_data', 'promote_front_presenter');
$schema->dropField('node_field_revision', 'promote_front_presenter');
$schema->dropField('node_field_data', 'promote_top_presenter');
$schema->dropField('node_field_revision', 'promote_top_presenter');
$schema->dropField('node_field_data', 'promote_channel');
$schema->dropField('node_field_revision', 'promote_channel');
$schema->dropField('node_field_data', 'promote_channel_presenter');
$schema->dropField('node_field_revision', 'promote_channel_presenter');
}
/**
* Update base fields to the schema.
*/
function infinite_base_update_8104() {
// Do nothing here any more. Add 8105 with migrate code when new field type is ready.
}