WordPress.org

Make WordPress Core

Ticket #40418: 40418.patch

File 40418.patch, 4.2 KB (added by johnjamesjacoby, 4 years ago)
  • src/wp-admin/includes/schema.php

    diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
    index 64ec6b7..a32b85c 100644
     
    242242
    243243        // Multisite global tables.
    244244        $ms_global_tables = "CREATE TABLE $wpdb->blogs (
    245   blog_id bigint(20) NOT NULL auto_increment,
    246   site_id bigint(20) NOT NULL default '0',
     245  blog_id bigint(20) unsigned NOT NULL auto_increment,
     246  site_id bigint(20) unsigned NOT NULL default '0',
    247247  domain varchar(200) NOT NULL default '',
    248248  path varchar(100) NOT NULL default '',
    249249  registered datetime NOT NULL default '0000-00-00 00:00:00',
     
    259259  KEY lang_id (lang_id)
    260260) $charset_collate;
    261261CREATE TABLE $wpdb->blog_versions (
    262   blog_id bigint(20) NOT NULL default '0',
     262  blog_id bigint(20) unsigned NOT NULL default '0',
    263263  db_version varchar(20) NOT NULL default '',
    264264  last_updated datetime NOT NULL default '0000-00-00 00:00:00',
    265265  PRIMARY KEY  (blog_id),
    266266  KEY db_version (db_version)
    267267) $charset_collate;
    268268CREATE TABLE $wpdb->registration_log (
    269   ID bigint(20) NOT NULL auto_increment,
     269  ID bigint(20) unsigned NOT NULL auto_increment,
    270270  email varchar(255) NOT NULL default '',
    271271  IP varchar(30) NOT NULL default '',
    272   blog_id bigint(20) NOT NULL default '0',
     272  blog_id bigint(20) unsigned NOT NULL default '0',
    273273  date_registered datetime NOT NULL default '0000-00-00 00:00:00',
    274274  PRIMARY KEY  (ID),
    275275  KEY IP (IP)
    276276) $charset_collate;
    277277CREATE TABLE $wpdb->site (
    278   id bigint(20) NOT NULL auto_increment,
     278  id bigint(20) unsigned NOT NULL auto_increment,
    279279  domain varchar(200) NOT NULL default '',
    280280  path varchar(100) NOT NULL default '',
    281281  PRIMARY KEY  (id),
    282282  KEY domain (domain(140),path(51))
    283283) $charset_collate;
    284284CREATE TABLE $wpdb->sitemeta (
    285   meta_id bigint(20) NOT NULL auto_increment,
    286   site_id bigint(20) NOT NULL default '0',
     285  meta_id bigint(20) unsigned NOT NULL auto_increment,
     286  site_id bigint(20) unsigned NOT NULL default '0',
    287287  meta_key varchar(255) default NULL,
    288288  meta_value longtext,
    289289  PRIMARY KEY  (meta_id),
     
    291291  KEY site_id (site_id)
    292292) $charset_collate;
    293293CREATE TABLE $wpdb->signups (
    294   signup_id bigint(20) NOT NULL auto_increment,
     294  signup_id bigint(20) unsigned NOT NULL auto_increment,
    295295  domain varchar(200) NOT NULL default '',
    296296  path varchar(100) NOT NULL default '',
    297297  title longtext NOT NULL,
  • src/wp-admin/includes/upgrade.php

    diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
    index 94ad771..7f5a8a3 100644
     
    28342834                        $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived varchar(1) NOT NULL default '0'" );
    28352835                        $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0" );
    28362836                }
     2837
     2838                // Upgrade versions prior to 4.8
     2839                if ( $wp_current_db_version < 39357 ) {
     2840                        // Convert ID columns from signed to unsigned
     2841                        $wpdb->query( "ALTER TABLE $wpdb->blogs MODIFY blog_id bigint(20) unsigned NOT NULL auto_increment" );
     2842                        $wpdb->query( "ALTER TABLE $wpdb->blogs MODIFY site_id bigint(20) unsigned NOT NULL default 0" );
     2843                        $wpdb->query( "ALTER TABLE $wpdb->blog_versions MODIFY blog_id bigint(20) unsigned NOT NULL default 0" );
     2844                        $wpdb->query( "ALTER TABLE $wpdb->registration_log MODIFY ID bigint(20) unsigned NOT NULL auto_increment" );
     2845                        $wpdb->query( "ALTER TABLE $wpdb->registration_log MODIFY blog_id bigint(20) unsigned NOT NULL default 0" );
     2846                        $wpdb->query( "ALTER TABLE $wpdb->site MODIFY id bigint(20) unsigned NOT NULL auto_increment" );
     2847                        $wpdb->query( "ALTER TABLE $wpdb->sitemeta MODIFY meta_id bigint(20) unsigned NOT NULL auto_increment" );
     2848                        $wpdb->query( "ALTER TABLE $wpdb->sitemeta MODIFY site_id bigint(20) unsigned NOT NULL default 0" );
     2849                        $wpdb->query( "ALTER TABLE $wpdb->signups MODIFY signup_id bigint(20) unsigned NOT NULL auto_increment" );
     2850                }
    28372851        }
    28382852
    28392853        // Upgrade versions prior to 4.2.
  • src/wp-includes/version.php

    diff --git src/wp-includes/version.php src/wp-includes/version.php
    index e01c790..20ca436 100644
     
    1111 *
    1212 * @global int $wp_db_version
    1313 */
    14 $wp_db_version = 38590;
     14$wp_db_version = 39357;
    1515
    1616/**
    1717 * Holds the TinyMCE version