WordPress.org

Make WordPress Core

Ticket #9435: 9435-smaller-int-fields.diff

File 9435-smaller-int-fields.diff, 2.5 KB (added by Denis-de-Bernardy, 6 years ago)

smaller int fields. surely no post will have over 65k comments?

  • Users/denis/Sites/wp/wp-admin/includes/schema.php

     
    3131 term_id bigint(20) unsigned NOT NULL auto_increment, 
    3232 name varchar(200) NOT NULL default '', 
    3333 slug varchar(200) NOT NULL default '', 
    34  term_group bigint(10) NOT NULL default 0, 
     34 term_group int(11) NOT NULL default 0, 
    3535 PRIMARY KEY  (term_id), 
    3636 UNIQUE KEY slug (slug), 
    3737 KEY name (name) 
     
    4242 taxonomy varchar(32) NOT NULL default '', 
    4343 description longtext NOT NULL, 
    4444 parent bigint(20) unsigned NOT NULL default 0, 
    45  count bigint(20) NOT NULL default 0, 
     45 count smallint(4) unsigned NOT NULL default 0, 
    4646 PRIMARY KEY  (term_taxonomy_id), 
    4747 UNIQUE KEY term_id_taxonomy (term_id,taxonomy), 
    4848 KEY taxonomy (taxonomy) 
     
    6464  comment_date datetime NOT NULL default '0000-00-00 00:00:00', 
    6565  comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', 
    6666  comment_content text NOT NULL, 
    67   comment_karma int(11) NOT NULL default '0', 
     67  comment_karma smallint(4) NOT NULL default '0', 
    6868  comment_approved varchar(20) NOT NULL default '1', 
    6969  comment_agent varchar(255) NOT NULL default '', 
    7070  comment_type varchar(20) NOT NULL default '', 
     
    8686  link_description varchar(255) NOT NULL default '', 
    8787  link_visible varchar(20) NOT NULL default 'Y', 
    8888  link_owner bigint(20) unsigned NOT NULL default '1', 
    89   link_rating int(11) NOT NULL default '0', 
     89  link_rating smallint(4) NOT NULL default '0', 
    9090  link_updated datetime NOT NULL default '0000-00-00 00:00:00', 
    9191  link_rel varchar(255) NOT NULL default '', 
    9292  link_notes mediumtext NOT NULL, 
     
    9797) $charset_collate; 
    9898CREATE TABLE $wpdb->options ( 
    9999  option_id bigint(20) unsigned NOT NULL auto_increment, 
    100   blog_id int(11) NOT NULL default '0', 
     100  blog_id bigint(20) unsigned NOT NULL default '0', 
    101101  option_name varchar(64) NOT NULL default '', 
    102102  option_value longtext NOT NULL, 
    103103  autoload varchar(20) NOT NULL default 'yes', 
     
    137137  menu_order int(11) NOT NULL default '0', 
    138138  post_type varchar(20) NOT NULL default 'post', 
    139139  post_mime_type varchar(100) NOT NULL default '', 
    140   comment_count bigint(20) NOT NULL default '0', 
     140  comment_count smallint(4) unsigned NOT NULL default '0', 
    141141  PRIMARY KEY  (ID), 
    142142  KEY post_name (post_name), 
    143143  KEY type_status_date (post_type,post_status,post_date,ID),