Skip to:
Content

BuddyPress.org

Changeset 9717


Ignore:
Timestamp:
04/07/2015 01:34:52 PM (10 years ago)
Author:
boonebgorges
Message:

In bp_pre_schema_upgrade(), only drop indexes if the table exists.

See [9716]. See #6346.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-update.php

    r9716 r9717  
    287287        foreach ( $tables as $table_name => $indexes ) {
    288288            foreach ( $indexes as $index ) {
    289                 $wpdb->query( "ALTER TABLE $table_name DROP INDEX $index" );
     289                if ( $wpdb->query( $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $table_name ) ) ) ) {
     290                    $wpdb->query( "ALTER TABLE $table_name DROP INDEX $index" );
     291                }
    290292            }
    291293        }
Note: See TracChangeset for help on using the changeset viewer.