'Dummy table to test the behavior of hook_schema() during module installation.', 'fields' => [ 'data' => [ '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() { $schema = drupal_get_module_schema('module_test', 'module_test'); db_insert('module_test') ->fields([ 'data' => $schema['fields']['data']['type'], ]) ->execute(); if (\Drupal::state()->get('module_test_install:rebuild_container')) { // Ensure that the container can be rebuilt during hook_install(). Doing // this in hook_install() is bad practice but it should not break anything. \Drupal::service('kernel')->rebuildContainer(); } }