You are here

function image_replace_update_8101 in Image Replace 8

Increase the index-length on the target_uri.

File

./image_replace.install, line 48
Database schema for image replace module.

Code

function image_replace_update_8101(&$sandbox) {
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->dropPrimaryKey('image_replace');
  $schema
    ->changeField('image_replace', 'target_uri', 'target_uri', [
    'description' => 'The original URI to access the file.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
    'binary' => TRUE,
  ]);
  $schema
    ->changeField('image_replace', 'replacement_uri', 'replacement_uri', [
    'description' => 'The replacement URI to use instead.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
    'binary' => TRUE,
  ]);
  $schema
    ->addPrimaryKey('image_replace', [
    'target_style',
    [
      'target_uri',
      191,
    ],
  ]);
}