WordPress.org

Make WordPress Core

Changeset 10852


Ignore:
Timestamp:
03/31/09 21:57:51 (5 years ago)
Author:
ryan
Message:

Enforce consistent ID types to allow for foreign keys to be defined between tables. Props Denis-de-Bernardy. see #9422

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/schema.php

    r10842 r10852  
    2929/** Create WordPress database tables SQL */ 
    3030$wp_queries = "CREATE TABLE $wpdb->terms ( 
    31  term_id bigint(20) NOT NULL auto_increment, 
     31 term_id bigint(20) unsigned NOT NULL auto_increment, 
    3232 name varchar(200) NOT NULL default '', 
    3333 slug varchar(200) NOT NULL default '', 
     
    3838) $charset_collate; 
    3939CREATE TABLE $wpdb->term_taxonomy ( 
    40  term_taxonomy_id bigint(20) NOT NULL auto_increment, 
    41  term_id bigint(20) NOT NULL default 0, 
     40 term_taxonomy_id bigint(20) unsigned NOT NULL auto_increment, 
     41 term_id bigint(20) unsigned NOT NULL default 0, 
    4242 taxonomy varchar(32) NOT NULL default '', 
    4343 description longtext NOT NULL, 
    44  parent bigint(20) NOT NULL default 0, 
     44 parent bigint(20) unsigned NOT NULL default 0, 
    4545 count bigint(20) NOT NULL default 0, 
    4646 PRIMARY KEY  (term_taxonomy_id), 
     
    4949) $charset_collate; 
    5050CREATE TABLE $wpdb->term_relationships ( 
    51  object_id bigint(20) NOT NULL default 0, 
    52  term_taxonomy_id bigint(20) NOT NULL default 0, 
     51 object_id bigint(20) unsigned NOT NULL default 0, 
     52 term_taxonomy_id bigint(20) unsigned NOT NULL default 0, 
    5353 term_order int(11) NOT NULL default 0, 
    5454 PRIMARY KEY  (object_id,term_taxonomy_id), 
     
    5757CREATE TABLE $wpdb->comments ( 
    5858  comment_ID bigint(20) unsigned NOT NULL auto_increment, 
    59   comment_post_ID int(11) NOT NULL default '0', 
     59  comment_post_ID bigint(20) unsigned NOT NULL default '0', 
    6060  comment_author tinytext NOT NULL, 
    6161  comment_author_email varchar(100) NOT NULL default '', 
     
    7070  comment_type varchar(20) NOT NULL default '', 
    7171  comment_parent bigint(20) NOT NULL default '0', 
    72   user_id bigint(20) NOT NULL default '0', 
     72  user_id bigint(20) unsigned NOT NULL default '0', 
    7373  PRIMARY KEY  (comment_ID), 
    7474  KEY comment_approved (comment_approved), 
     
    7878) $charset_collate; 
    7979CREATE TABLE $wpdb->links ( 
    80   link_id bigint(20) NOT NULL auto_increment, 
     80  link_id bigint(20) unsigned NOT NULL auto_increment, 
    8181  link_url varchar(255) NOT NULL default '', 
    8282  link_name varchar(255) NOT NULL default '', 
     
    8686  link_description varchar(255) NOT NULL default '', 
    8787  link_visible varchar(20) NOT NULL default 'Y', 
    88   link_owner int(11) NOT NULL default '1', 
     88  link_owner bigint(20) NOT NULL default '1', 
    8989  link_rating int(11) NOT NULL default '0', 
    9090  link_updated datetime NOT NULL default '0000-00-00 00:00:00', 
     
    9797) $charset_collate; 
    9898CREATE TABLE $wpdb->options ( 
    99   option_id bigint(20) NOT NULL auto_increment, 
     99  option_id bigint(20) unsigned NOT NULL auto_increment, 
    100100  blog_id int(11) NOT NULL default '0', 
    101101  option_name varchar(64) NOT NULL default '', 
     
    106106) $charset_collate; 
    107107CREATE TABLE $wpdb->postmeta ( 
    108   meta_id bigint(20) NOT NULL auto_increment, 
    109   post_id bigint(20) NOT NULL default '0', 
     108  meta_id bigint(20) unsigned NOT NULL auto_increment, 
     109  post_id bigint(20) unsigned NOT NULL default '0', 
    110110  meta_key varchar(255) default NULL, 
    111111  meta_value longtext, 
     
    116116CREATE TABLE $wpdb->posts ( 
    117117  ID bigint(20) unsigned NOT NULL auto_increment, 
    118   post_author bigint(20) NOT NULL default '0', 
     118  post_author bigint(20) unsigned NOT NULL default '0', 
    119119  post_date datetime NOT NULL default '0000-00-00 00:00:00', 
    120120  post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00', 
     
    133133  post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00', 
    134134  post_content_filtered text NOT NULL, 
    135   post_parent bigint(20) NOT NULL default '0', 
     135  post_parent bigint(20) unsigned NOT NULL default '0', 
    136136  guid varchar(255) NOT NULL default '', 
    137137  menu_order int(11) NOT NULL default '0', 
     
    160160) $charset_collate; 
    161161CREATE TABLE $wpdb->usermeta ( 
    162   umeta_id bigint(20) NOT NULL auto_increment, 
    163   user_id bigint(20) NOT NULL default '0', 
     162  umeta_id bigint(20) unsigned NOT NULL auto_increment, 
     163  user_id bigint(20) unsigned NOT NULL default '0', 
    164164  meta_key varchar(255) default NULL, 
    165165  meta_value longtext, 
  • trunk/wp-includes/version.php

    r10768 r10852  
    1616 * @global int $wp_db_version 
    1717 */ 
    18 $wp_db_version = 10738; 
     18$wp_db_version = 10850; 
    1919 
    2020?> 
Note: See TracChangeset for help on using the changeset viewer.