summaryrefslogtreecommitdiffstats
path: root/wp-admin/upgrade-schema.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-02-05 11:49:12 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2007-02-05 11:49:12 +0000
commit6ef7b48c2da1ad9731e1f4734be86ed3ae5afca0 (patch)
tree0a0c0a8c8146ef18a1aa87016c9a3f7e3ced1618 /wp-admin/upgrade-schema.php
parent4c4e0fc82e70e810472721ad23aac64ba2c5b6e1 (diff)
WP Merge to rev 4865
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@879 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/upgrade-schema.php')
-rw-r--r--wp-admin/upgrade-schema.php28
1 files changed, 18 insertions, 10 deletions
diff --git a/wp-admin/upgrade-schema.php b/wp-admin/upgrade-schema.php
index 61e1eb4..610ccc9 100644
--- a/wp-admin/upgrade-schema.php
+++ b/wp-admin/upgrade-schema.php
@@ -2,6 +2,14 @@
// Here we keep the DB structure and option values
global $wp_queries;
+$charset_collate = '';
+
+if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
+ if ( ! empty($wpdb->charset) )
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
+ if ( ! empty($wpdb->collate) )
+ $charset_collate .= " COLLATE $wpdb->collate";
+}
$wp_queries="CREATE TABLE $wpdb->categories (
cat_ID bigint(20) NOT NULL auto_increment,
@@ -15,7 +23,7 @@ $wp_queries="CREATE TABLE $wpdb->categories (
links_private tinyint(1) NOT NULL default '0',
PRIMARY KEY (cat_ID),
KEY category_nicename (category_nicename)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->comments (
comment_ID bigint(20) unsigned NOT NULL auto_increment,
comment_post_ID int(11) NOT NULL default '0',
@@ -35,14 +43,14 @@ CREATE TABLE $wpdb->comments (
PRIMARY KEY (comment_ID),
KEY comment_approved (comment_approved),
KEY comment_post_ID (comment_post_ID)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->link2cat (
rel_id bigint(20) NOT NULL auto_increment,
link_id bigint(20) NOT NULL default '0',
category_id bigint(20) NOT NULL default '0',
PRIMARY KEY (rel_id),
KEY link_id (link_id,category_id)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->links (
link_id bigint(20) NOT NULL auto_increment,
link_url varchar(255) NOT NULL default '',
@@ -61,7 +69,7 @@ CREATE TABLE $wpdb->links (
PRIMARY KEY (link_id),
KEY link_category (link_category),
KEY link_visible (link_visible)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->options (
option_id bigint(20) NOT NULL auto_increment,
blog_id int(11) NOT NULL default '0',
@@ -76,14 +84,14 @@ CREATE TABLE $wpdb->options (
autoload enum('yes','no') NOT NULL default 'yes',
PRIMARY KEY (option_id,blog_id,option_name),
KEY option_name (option_name)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->post2cat (
rel_id bigint(20) NOT NULL auto_increment,
post_id bigint(20) NOT NULL default '0',
category_id bigint(20) NOT NULL default '0',
PRIMARY KEY (rel_id),
KEY post_id (post_id,category_id)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->postmeta (
meta_id bigint(20) NOT NULL auto_increment,
post_id bigint(20) NOT NULL default '0',
@@ -92,7 +100,7 @@ CREATE TABLE $wpdb->postmeta (
PRIMARY KEY (meta_id),
KEY post_id (post_id),
KEY meta_key (meta_key)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->posts (
ID bigint(20) unsigned NOT NULL auto_increment,
post_author bigint(20) NOT NULL default '0',
@@ -121,7 +129,7 @@ CREATE TABLE $wpdb->posts (
PRIMARY KEY (ID),
KEY post_name (post_name),
KEY type_status_date (post_type,post_status,post_date,ID)
-) TYPE=MyISAM;
+) $charset_collate;
CREATE TABLE $wpdb->users (
ID bigint(20) unsigned NOT NULL auto_increment,
user_login varchar(60) NOT NULL default '',
@@ -137,7 +145,7 @@ CREATE TABLE $wpdb->users (
deleted tinyint(2) NOT NULL default '0',
PRIMARY KEY (ID),
KEY user_login_key (user_login)
-);
+) $charset_collate;
CREATE TABLE $wpdb->usermeta (
umeta_id bigint(20) NOT NULL auto_increment,
user_id bigint(20) NOT NULL default '0',
@@ -146,7 +154,7 @@ CREATE TABLE $wpdb->usermeta (
PRIMARY KEY (umeta_id),
KEY user_id (user_id),
KEY meta_key (meta_key)
-);
+) $charset_collate;";
CREATE TABLE $wpdb->blogs (
blog_id bigint(20) NOT NULL auto_increment,
site_id bigint(20) NOT NULL default '0',