From 282ceaef6fbbd948dd76d3528316a97c18e26ccd Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sat, 3 Nov 2018 14:49:28 -0400 Subject: [PATCH] Delete index before dropping table --- includes/schema.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/includes/schema.php b/includes/schema.php index 82b1730..5fa560b 100644 --- a/includes/schema.php +++ b/includes/schema.php @@ -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' ); } ?>