You are here

function migrate_delete_content_set in Migrate 6

Delete the specified content set, including map and message tables.

Parameters

$mcsid: Unique identifier of the content set to delete.

2 calls to migrate_delete_content_set()
MigrateUnitTest::testCRUD in tests/migrate_api.test
Test API for managing content sets
migrate_content_set_mappings_submit in ./migrate_pages.inc
Implementation of hook_submit().

File

./migrate.module, line 302
This module provides tools at "administer >> content >> migrate" for analyzing data from various sources and importing them into Drupal tables.

Code

function migrate_delete_content_set($mcsid) {

  // First, remove the map and message tables from the Table Wizard, and drop them
  $ret = array();
  $maptable = migrate_map_table_name($mcsid);
  $msgtable = migrate_message_table_name($mcsid);
  if (db_table_exists($maptable)) {
    tw_remove_tables(array(
      $maptable,
      $msgtable,
    ));
    db_drop_table($ret, $maptable);
    db_drop_table($ret, $msgtable);
  }

  // Then, delete the content set data
  $sql = "DELETE FROM {migrate_content_mappings} WHERE mcsid=%d";
  db_query($sql, $mcsid);
  $sql = "DELETE FROM {migrate_content_sets} WHERE mcsid=%d";
  db_query($sql, $mcsid);
}