Skip to content

Instantly share code, notes, and snippets.

@rachelwhitton
Created October 12, 2020 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rachelwhitton/a348b3aff2aabf867dccd8188bcddb12 to your computer and use it in GitHub Desktop.
Save rachelwhitton/a348b3aff2aabf867dccd8188bcddb12 to your computer and use it in GitHub Desktop.
Patch meta_key index on Posts 2 Posts plugin
diff --git a/wp-content/plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/storage.php b/wp-content/plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/storage.php
index cede3e8e..e60fa99b 100644
--- a/wp-content/plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/storage.php
+++ b/wp-content/plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/storage.php
@@ -27,6 +27,7 @@ class P2P_Storage {
KEY p2p_type (p2p_type)
" );
+ // @see /wp-admin/includes/schema.php:53 - for "KEY meta_key (meta_key(191))" change
scb_install_table( 'p2pmeta', "
meta_id bigint(20) unsigned NOT NULL auto_increment,
p2p_id bigint(20) unsigned NOT NULL default '0',
@@ -34,7 +35,7 @@ class P2P_Storage {
meta_value longtext,
PRIMARY KEY (meta_id),
KEY p2p_id (p2p_id),
- KEY meta_key (meta_key)
+ KEY meta_key (meta_key(191))
" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment