You are here

function redhen_org_update_8101 in RedHen CRM 8

Change the redhen org name to 255 characters.

File

modules/redhen_org/redhen_org.install, line 11
Install & update hooks for the Redhen Org module.

Code

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} )");
}