WordPress.org

Make WordPress Core

Ticket #4189: taxonomy-schema.diff

File taxonomy-schema.diff, 3.1 KB (added by majelbstoat, 15 years ago)

Schema alterations

  • upgrade-schema.php

     
    1010                $charset_collate .= " COLLATE $wpdb->collate";
    1111}
    1212
    13 $wp_queries="CREATE TABLE $wpdb->categories (
    14   cat_ID bigint(20) NOT NULL auto_increment,
    15   cat_name varchar(55) NOT NULL default '',
    16   category_nicename varchar(200) NOT NULL default '',
    17   category_description longtext NOT NULL,
    18   category_parent bigint(20) NOT NULL default '0',
    19   category_count bigint(20) NOT NULL default '0',
    20   link_count bigint(20) NOT NULL default '0',
    21   tag_count bigint(20) NOT NULL default '0',
    22   posts_private tinyint(1) NOT NULL default '0',
    23   links_private tinyint(1) NOT NULL default '0',
    24   type tinyint NOT NULL default '1',
    25   PRIMARY KEY  (cat_ID),
    26   KEY category_nicename (category_nicename)
     13$wp_queries="CREATE TABLE $wpdb->terms (
     14 term_id bigint(20) NOT NULL auto_increment,
     15 term_name varchar(55) NOT NULL default '',
     16 term_slug varchar(200) NOT NULL default '',
     17 term_group bigint(10) NOT NULL default 0
     18 PRIMARY KEY  (term_id),
     19 UNIQUE KEY term_slug (term_slug)
    2720) $charset_collate;
     21CREATE TABLE $wpdb->taxonomies (
     22 taxonomy_id int (5) NOT NULL auto_increment,
     23 taxonomy varchar(20) NOT NULL default 0,
     24 PRIMARY KEY  (taxonomy_id)
     25) $charset_collate;
     26CREATE TABLE $wpdb->term_taxonomy (
     27 term_taxonomy_id bigint(20) NOT NULL auto_increment,
     28 term_id bigint(20) NOT NULL default 0,
     29 taxonomy_id int(5) NOT NULL default 0,
     30 term_description longtext NOT NULL,
     31 parent bigint(20) NOT NULL default 0,
     32 count bigint(20) NOT NULL default 0,
     33 PRIMARY KEY (term_taxonomy_id),
     34 UNIQUE KEY (term_id, taxonomy_id)
     35) $charset_collate;
     36CREATE TABLE $wpdb->term_relationships (
     37 object_id bigint(20) NOT NULL default 0,
     38 term_taxonomy_id bigint(20) NOT NULL default 0,
     39 PRIMARY KEY  (object_id),
     40 KEY (term_taxonomy_id)
     41) $charset_collate;
    2842CREATE TABLE $wpdb->comments (
    2943  comment_ID bigint(20) unsigned NOT NULL auto_increment,
    3044  comment_post_ID int(11) NOT NULL default '0',
     
    4559  KEY comment_approved (comment_approved),
    4660  KEY comment_post_ID (comment_post_ID)
    4761) $charset_collate;
    48 CREATE TABLE $wpdb->link2cat (
    49   rel_id bigint(20) NOT NULL auto_increment,
    50   link_id bigint(20) NOT NULL default '0',
    51   category_id bigint(20) NOT NULL default '0',
    52   PRIMARY KEY  (rel_id),
    53   KEY link_id (link_id,category_id)
    54 ) $charset_collate;
    5562CREATE TABLE $wpdb->links (
    5663  link_id bigint(20) NOT NULL auto_increment,
    5764  link_url varchar(255) NOT NULL default '',
     
    8693  PRIMARY KEY  (option_id,blog_id,option_name),
    8794  KEY option_name (option_name)
    8895) $charset_collate;
    89 CREATE TABLE $wpdb->post2cat (
    90   rel_id bigint(20) NOT NULL auto_increment,
    91   post_id bigint(20) NOT NULL default '0',
    92   category_id bigint(20) NOT NULL default '0',
    93   rel_type varchar(64) NOT NULL default 'category',
    94   PRIMARY KEY  (rel_id),
    95   KEY post_id (post_id,category_id)
    96 ) $charset_collate;
    9796CREATE TABLE $wpdb->postmeta (
    9897  meta_id bigint(20) NOT NULL auto_increment,
    9998  post_id bigint(20) NOT NULL default '0',