WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/02/2007 12:04:35 AM (13 years ago)
Author:
ryan
Message:

First cut at mysql utf-8 charset suport. Props to sehh, drupal, and textpattern. fixes #3517

File:
1 edited

Legend:

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

    r4832 r4860  
    11<?php
    22// Here we keep the DB structure and option values
     3
     4$charset_collate = '';
     5   
     6if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
     7    if ( ! empty($wpdb->charset) )
     8        $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
     9    if ( ! empty($wpdb->collate) )
     10        $charset_collate .= " COLLATE $wpdb->collate"; 
     11}
    312
    413$wp_queries="CREATE TABLE $wpdb->categories (
     
    1423  PRIMARY KEY  (cat_ID),
    1524  KEY category_nicename (category_nicename)
    16 );
     25) $charset_collate;
    1726CREATE TABLE $wpdb->comments (
    1827  comment_ID bigint(20) unsigned NOT NULL auto_increment,
     
    3443  KEY comment_approved (comment_approved),
    3544  KEY comment_post_ID (comment_post_ID)
    36 );
     45) $charset_collate;
    3746CREATE TABLE $wpdb->link2cat (
    3847  rel_id bigint(20) NOT NULL auto_increment,
     
    4150  PRIMARY KEY  (rel_id),
    4251  KEY link_id (link_id,category_id)
    43 );
     52) $charset_collate;
    4453CREATE TABLE $wpdb->links (
    4554  link_id bigint(20) NOT NULL auto_increment,
     
    6069  KEY link_category (link_category),
    6170  KEY link_visible (link_visible)
    62 );
     71) $charset_collate;
    6372CREATE TABLE $wpdb->options (
    6473  option_id bigint(20) NOT NULL auto_increment,
     
    7584  PRIMARY KEY  (option_id,blog_id,option_name),
    7685  KEY option_name (option_name)
    77 );
     86) $charset_collate;
    7887CREATE TABLE $wpdb->post2cat (
    7988  rel_id bigint(20) NOT NULL auto_increment,
     
    8291  PRIMARY KEY  (rel_id),
    8392  KEY post_id (post_id,category_id)
    84 );
     93) $charset_collate;
    8594CREATE TABLE $wpdb->postmeta (
    8695  meta_id bigint(20) NOT NULL auto_increment,
     
    91100  KEY post_id (post_id),
    92101  KEY meta_key (meta_key)
    93 );
     102) $charset_collate;
    94103CREATE TABLE $wpdb->posts (
    95104  ID bigint(20) unsigned NOT NULL auto_increment,
     
    120129  KEY post_name (post_name),
    121130  KEY type_status_date (post_type,post_status,post_date,ID)
    122 );
     131) $charset_collate;
    123132CREATE TABLE $wpdb->users (
    124133  ID bigint(20) unsigned NOT NULL auto_increment,
     
    134143  PRIMARY KEY  (ID),
    135144  KEY user_login_key (user_login)
    136 );
     145) $charset_collate;
    137146CREATE TABLE $wpdb->usermeta (
    138147  umeta_id bigint(20) NOT NULL auto_increment,
     
    143152  KEY user_id (user_id),
    144153  KEY meta_key (meta_key)
    145 );";
     154) $charset_collate;";
    146155
    147156function populate_options() {
Note: See TracChangeset for help on using the changeset viewer.