You are here

redhen_org.install in RedHen CRM 8

Same filename and directory in other branches
  1. 7 modules/redhen_org/redhen_org.install

Install & update hooks for the Redhen Org module.

File

modules/redhen_org/redhen_org.install
View source
<?php

/**
 * @file
 * Install & update hooks for the Redhen Org module.
 */

/**
 * Change the redhen org name to 255 characters.
 */
function redhen_org_update_8101() {
  $table = 'redhen_org';
  $revision_table = 'redhen_org_revision';
  $column = 'name';
  $max_length = 255;

  // Alter value field length in fields table:

  /** @var \Drupal\Core\Database\Connection $database_replica */
  $database_replica = \Drupal::service('database.replica');
  $database_replica
    ->query("ALTER TABLE `{$table}` CHANGE `{$column}` `{$column}` VARCHAR( {$max_length} )");

  // Alter value field length in fields revision table:
  $database_replica
    ->query("ALTER TABLE `{$revision_table}` CHANGE `{$column}` `{$column}` VARCHAR( {$max_length} )");
}

Functions

Namesort descending Description
redhen_org_update_8101 Change the redhen org name to 255 characters.