-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmissing_files_admin.install
More file actions
39 lines (34 loc) · 931 Bytes
/
missing_files_admin.install
File metadata and controls
39 lines (34 loc) · 931 Bytes
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
<?php
/**
* Implements hook_install().
*/
function missing_files_admin_install() {
missing_files_admin_db_add_file_exists_field();
}
/**
* Implements hook_uninstall().
*/
function missing_files_admin_uninstall() {
missing_files_admin_db_drop_file_exists_field();
}
/**
* Add 'file_exists' column to 'field_managed'.
*/
function missing_files_admin_db_add_file_exists_field() {
$field = array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
'default' => NULL,
'description' => '1 for exists, 0 for missing.',
);
db_add_field('file_managed', 'file_exists', $field);
drupal_set_message("Added 'file_exists' column to 'field_managed'.");
}
/**
* Add 'file_exists' column to 'field_managed'.
*/
function missing_files_admin_db_drop_file_exists_field() {
db_drop_field('file_managed', 'file_exists');
drupal_set_message("Dropped 'file_exists' column from 'field_managed'.");
}