You are here

function data_search_install in Data 8

Same name and namespace in other branches
  1. 6 data_search/data_search.install \data_search_install()
  2. 7 data_search/data_search.install \data_search_install()

Implements hook_install().

@todo: Should use db_change_field() @todo: What happens if data_search and search are installed at the same time?

File

data_search/data_search.install, line 15
Install, update and uninstall functions for the data_search module.

Code

function data_search_install() {
  $connection = \Drupal::database();

  // Adjust length of type columns for data tables with names of a max length of 64.
  $connection
    ->query("ALTER TABLE {search_dataset} CHANGE COLUMN type type VARCHAR(64)");
  $connection
    ->query("ALTER TABLE {search_index} CHANGE COLUMN type type VARCHAR(64)");
  $connection
    ->query("ALTER TABLE {search_node_links} CHANGE COLUMN type type VARCHAR(64)");
}