5 * Install, update and uninstall functions for the module_test module.
9 * Implements hook_schema().
11 function module_test_schema() {
12 $schema['module_test'] = [
13 'description' => 'Dummy table to test the behavior of hook_schema() during module installation.',
20 'description' => 'An example data column for the module.',
28 * Implements hook_install().
30 function module_test_install() {
31 $schema = drupal_get_module_schema('module_test', 'module_test');
32 db_insert('module_test')
34 'data' => $schema['fields']['data']['type'],
37 if (\Drupal::state()->get('module_test_install:rebuild_container')) {
38 // Ensure that the container can be rebuilt during hook_install(). Doing
39 // this in hook_install() is bad practice but it should not break anything.
40 \Drupal::service('kernel')->rebuildContainer();