WordPress.org

Make WordPress Core

Ticket #37686: 37686.diff

File 37686.diff, 771 bytes (added by johnjamesjacoby, 3 years ago)

First pass at adding the object_type column with a compound index to include it along with object_id and term_taxonomy_id

  • src/wp-admin/includes/schema.php

    diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
    index 83ba531..76fdb6f 100644
     
    8383) $charset_collate;
    8484CREATE TABLE $wpdb->term_relationships (
    8585 object_id bigint(20) unsigned NOT NULL default 0,
     86 object_type varchar(20) NOT NULL default 'post',
    8687 term_taxonomy_id bigint(20) unsigned NOT NULL default 0,
    8788 term_order int(11) NOT NULL default 0,
    8889 PRIMARY KEY  (object_id,term_taxonomy_id),
    89  KEY term_taxonomy_id (term_taxonomy_id)
     90 KEY term_taxonomy_id (term_taxonomy_id),
     91 KEY oid_otype_ttid (object_id,object_type,term_taxonomy_id)
    9092) $charset_collate;
    9193CREATE TABLE $wpdb->commentmeta (
    9294  meta_id bigint(20) unsigned NOT NULL auto_increment,