You are here

function bootstrap_simple_carousel_update_8400 in bootstrap simple carousel 8

Add a weight field to {bootstrap_simple_carousel} table.

File

./bootstrap_simple_carousel.install, line 96
Defines install of bootstrap simple carousel.

Code

function bootstrap_simple_carousel_update_8400() {
  $image_link = [
    'type' => 'varchar_ascii',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ];
  $schema = Database::getConnection()
    ->schema();
  $schema
    ->addField('bootstrap_simple_carousel', 'image_link', $image_link);
  $config_factory = \Drupal::configFactory();
  $config = $config_factory
    ->getEditable('bootstrap_simple_carousel.settings');
  $image_fluid = $config
    ->get('image_fluid');
  if ($image_fluid) {
    $config
      ->set('image_type', SettingsForm::FLUID_IMAGE_TYPE_ID)
      ->save(TRUE);
  }
}