You are here

function migrate_example_update_7002 in Migrate 7.2

Add image alt/title/description columns.

File

migrate_example/migrate_example.install, line 85

Code

function migrate_example_update_7002() {
  $ret = array();
  db_add_field('migrate_example_beer_node', 'image_alt', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
    'description' => 'Image ALT',
  ));
  db_add_field('migrate_example_beer_node', 'image_title', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
    'description' => 'Image title',
  ));
  db_add_field('migrate_example_beer_node', 'image_description', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
    'description' => 'Image description',
  ));
  db_update('migrate_example_beer_node')
    ->fields(array(
    'image_alt' => 'Heinekin alt',
    'image_title' => 'Heinekin title',
    'image_description' => 'Heinekin description',
  ))
    ->condition('bid', 99999999)
    ->execute();
  $ret[] = t('Added image_alt, image_title, and image_description fields.');
  return $ret;
}