we_megamenu.install in Drupal Mega Menu 8.x
Same filename and directory in other branches
Create table we_megamenu().
File
we_megamenu.installView source
<?php
/**
* @file
* Create table we_megamenu().
*/
/**
* Implements hook_schema().
*/
function we_megamenu_schema() {
$schema['we_megamenu'] = [
'fields' => [
'menu_name' => [
'type' => 'varchar',
'length' => 150,
'not null' => TRUE,
],
'theme' => [
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
],
'data_config' => [
'type' => 'text',
'not null' => FALSE,
'size' => 'big',
],
],
'primary key' => [
'menu_name',
'theme',
],
];
return $schema;
}
/**
* Implements hook_update().
*/
function we_megamenu_update_8101() {
$sql = 'ALTER TABLE `we_megamenu` CHANGE `data_config` `data_config` LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL';
\Drupal\Core\Database\Database::getConnection()
->query($sql);
}
Functions
Name | Description |
---|---|
we_megamenu_schema | Implements hook_schema(). |
we_megamenu_update_8101 | Implements hook_update(). |