You are here

function migrate_update_7202 in Migrate 7.2

Add rollback_action field to all map tables in the Drupal database.

File

./migrate.install, line 446
Migrate module installation

Code

function migrate_update_7202() {

  // Note this won't catch any prefixed tables, or any stored in the source
  // database - ensureTables() will take care of those.
  foreach (db_find_tables('migrate_map_%') as $tablename) {
    if (!db_field_exists($tablename, 'rollback_action')) {
      db_add_field($tablename, 'rollback_action', array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Flag indicating what to do for this item on rollback',
      ));
    }
  }
  $ret = t('Added rollback_action column to all map tables');
  return $ret;
}