Delete index before dropping table

This commit is contained in:
Jeremy Dormitzer 2018-11-03 14:49:28 -04:00
parent 8c26292280
commit 282ceaef6f

View File

@ -309,21 +309,19 @@ function purge_all_data() {
$request->add_header( 'Content-Type', 'application/ld+json' );
$server->dispatch( $request );
$pfx = $wpdb->prefix;
$wpdb->query( $wpdb->prepare(
"DROP INDEX OBJECTS_ACTIVITYPUB_ID_INDEX ON {$pfx}pterotype_objects"
) );
$wpdb->query( $wpdb->prepare(
"
DROP TABLE {$pfx}pterotype_comments, {$pfx}pterotype_keys,
{$pfx}pterotype_blocks, {$pfx}pterotype_shares,
{$pfx}pterotype_following, {$pfx}pterotype_followers,
{$pfx}pterotype_actor_likes, {$pfx}pterotype_object_likes,
{$pfx}pterotype_outbox, {$pfx}pterotype_inbox
{$pfx}pterotype_outbox, {$pfx}pterotype_inbox,
{$pfx}pterotype_actors, {$pfx}pterotype_objects
"
) );
$wpdb->query( $wpdb->prepare(
"DROP TABLE {$pfx}pterotype_actors"
) );
$wpdb->query( $wpdb->prepare(
"DROP TABLE {$pfx}pterotype_objects"
) );
\delete_option( 'pterotype_previously_migrated_version' );
}
?>