blob: 4cc09df5a8d2b21479cca1484e3b52fc34d0bb31 (
plain) (
blame)
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
|
<?php
/**
* @file
* Install, update and uninstall functions for the module_test module.
*/
/**
* Implements hook_schema().
*/
function module_test_schema() {
$schema['module_test'] = array(
'description' => 'Dummy table to test the behavior of hook_schema() during module installation.',
'fields' => array(
'data' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => 'An example data column for the module.',
),
),
);
return $schema;
}
/**
* Implements hook_install().
*/
function module_test_install() {
$record = array('data' => 'Data inserted in hook_install()');
drupal_write_record('module_test', $record);
}
/**
* Implements hook_enable().
*/
function module_test_enable() {
$record = array('data' => 'Data inserted in hook_enable()');
drupal_write_record('module_test', $record);
}
|