• Resolved cjyabraham

    (@cjyabraham)


    Hi,
    We are trying to speed up our search and want to give the custom usermeta table a try. When we enable this option, it appears to run a migration, however, no new usermeta table gets created in our DB. I think this is likely due to permissions on our prod servers. Is there some SQL we can run manually that will create this table for us?

    Thanks,
    Chris

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mykyta Synelnikov

    (@nsinelnikov)

    Hi @cjyabraham

    There is a code for usermeta table creation.

    global $wpdb;
    
    			$charset_collate = $wpdb->get_charset_collate();
    
    			$sql = "CREATE TABLE {$wpdb->prefix}um_metadata (
    umeta_id bigint(20) unsigned NOT NULL auto_increment,
    user_id bigint(20) unsigned NOT NULL default '0',
    um_key varchar(255) default NULL,
    um_value longtext default NULL,
    PRIMARY KEY  (umeta_id),
    KEY user_id_indx (user_id),
    KEY meta_key_indx (um_key),
    KEY meta_value_indx (um_value(191))
    ) $charset_collate;";
    
    			require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    			dbDelta( $sql );

    I highly recommend to turn on DEBUG LOG and re-run migration process.
    You could find the list of the issues in wp-content/degub.log file.

    Let me know about them,
    Thanks!

    Thread Starter cjyabraham

    (@cjyabraham)

    Great. Thanks for the help with this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SQL for custom usermeta table?’ is closed to new replies.