You are here

function s3fs_update_8303 in S3 File System 8.3

Same name and namespace in other branches
  1. 4.0.x s3fs.install \s3fs_update_8303()

Alter db version field to varchar(255).

File

./s3fs.install, line 285
Install, update and uninstall functions for the S3 File System module.

Code

function s3fs_update_8303() {
  $newField = [
    'description' => 'The S3 VersionId of the object.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
    'default' => '',
  ];
  $connection = \Drupal::database();
  try {
    $connection
      ->schema()
      ->dropTable('s3fs_file_temp');
  } catch (SchemaObjectDoesNotExistException $e) {

    // It is ok that the table does not exist.
  }
  $connection
    ->schema()
    ->changeField('s3fs_file', 'version', 'version', $newField);
}