Commit 7178f2f9 authored by Dries's avatar Dries

- Patch #79428 by Chris Johnson: remove int display width declarations from...

- Patch #79428 by Chris Johnson: remove int display width declarations from MySQL create table statements.
parent 3646f891
......@@ -54,7 +54,7 @@ function drupal_test_mysql($url, &$success) {
$success = array('CONNECT');
// Test CREATE.
$query = 'CREATE TABLE drupal_install_test (id int(1) NULL)';
$query = 'CREATE TABLE drupal_install_test (id int NULL)';
$result = mysql_query($query);
if ($error = mysql_error()) {
drupal_set_message(st('We were unable to create a test table on your MySQL database server with the command %query. MySQL reports the following message: %error.<ul><li>Are you sure the configured username has the necessary MySQL permissions to create tables in the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%query' => $query, '%error' => $error)), 'error');
......
......@@ -54,7 +54,7 @@ function drupal_test_mysqli($url, &$success) {
$success = array('CONNECT');
// Test CREATE.
$query = 'CREATE TABLE drupal_install_test (id int(1) NULL)';
$query = 'CREATE TABLE drupal_install_test (id int NULL)';
$result = mysqli_query($connection, $query);
if ($error = mysqli_error($connection)) {
drupal_set_message(st('We were unable to create a test table on your MySQL database server with the command %query. MySQL reports the following message: %error.<ul><li>Are you sure the configured username has the necessary MySQL permissions to create tables in the database?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%query' => $query, '%error' => $error)), 'error');
......
......@@ -6,51 +6,51 @@ function aggregator_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {aggregator_category} (
cid int(10) NOT NULL auto_increment,
cid int NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
description longtext NOT NULL,
block tinyint(2) NOT NULL default '0',
block tinyint NOT NULL default '0',
PRIMARY KEY (cid),
UNIQUE KEY title (title)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_category_feed} (
fid int(10) NOT NULL default '0',
cid int(10) NOT NULL default '0',
fid int NOT NULL default '0',
cid int NOT NULL default '0',
PRIMARY KEY (fid,cid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_category_item} (
iid int(10) NOT NULL default '0',
cid int(10) NOT NULL default '0',
iid int NOT NULL default '0',
cid int NOT NULL default '0',
PRIMARY KEY (iid,cid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_feed} (
fid int(10) NOT NULL auto_increment,
fid int NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
url varchar(255) NOT NULL default '',
refresh int(10) NOT NULL default '0',
checked int(10) NOT NULL default '0',
refresh int NOT NULL default '0',
checked int NOT NULL default '0',
link varchar(255) NOT NULL default '',
description longtext NOT NULL,
image longtext NOT NULL,
etag varchar(255) NOT NULL default '',
modified int(10) NOT NULL default '0',
block tinyint(2) NOT NULL default '0',
modified int NOT NULL default '0',
block tinyint NOT NULL default '0',
PRIMARY KEY (fid),
UNIQUE KEY link (url),
UNIQUE KEY title (title)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {aggregator_item} (
iid int(10) NOT NULL auto_increment,
fid int(10) NOT NULL default '0',
iid int NOT NULL auto_increment,
fid int NOT NULL default '0',
title varchar(255) NOT NULL default '',
link varchar(255) NOT NULL default '',
author varchar(255) NOT NULL default '',
description longtext NOT NULL,
timestamp int(11) default NULL,
timestamp int default NULL,
guid varchar(255),
PRIMARY KEY (iid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
......
......@@ -6,10 +6,10 @@ function book_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {book} (
vid int(10) unsigned NOT NULL default '0',
nid int(10) unsigned NOT NULL default '0',
parent int(10) NOT NULL default '0',
weight tinyint(3) NOT NULL default '0',
vid int unsigned NOT NULL default '0',
nid int unsigned NOT NULL default '0',
parent int NOT NULL default '0',
weight tinyint NOT NULL default '0',
PRIMARY KEY (vid),
KEY nid (nid),
KEY parent (parent)
......
......@@ -6,12 +6,12 @@ function contact_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {contact} (
cid int(10) unsigned NOT NULL auto_increment,
cid int unsigned NOT NULL auto_increment,
category varchar(255) NOT NULL default '',
recipients longtext NOT NULL default '',
reply longtext NOT NULL default '',
weight tinyint(3) NOT NULL default '0',
selected tinyint(1) NOT NULL default '0',
weight tinyint NOT NULL default '0',
selected tinyint NOT NULL default '0',
PRIMARY KEY (cid),
UNIQUE KEY category (category)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
......
......@@ -6,22 +6,22 @@ function drupal_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {client} (
cid int(10) unsigned NOT NULL auto_increment,
cid int unsigned NOT NULL auto_increment,
link varchar(255) NOT NULL default '',
name varchar(128) NOT NULL default '',
mail varchar(128) NOT NULL default '',
slogan longtext NOT NULL,
mission longtext NOT NULL,
users int(10) NOT NULL default '0',
nodes int(10) NOT NULL default '0',
users int NOT NULL default '0',
nodes int NOT NULL default '0',
version varchar(35) NOT NULL default'',
created int(11) NOT NULL default '0',
changed int(11) NOT NULL default '0',
created int NOT NULL default '0',
changed int NOT NULL default '0',
PRIMARY KEY (cid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {client_system} (
cid int(10) NOT NULL default '0',
cid int NOT NULL default '0',
name varchar(255) NOT NULL default '',
type varchar(255) NOT NULL default '',
PRIMARY KEY (cid,name)
......
......@@ -6,9 +6,9 @@ function forum_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {forum} (
nid int(10) unsigned NOT NULL default '0',
vid int(10) unsigned NOT NULL default '0',
tid int(10) unsigned NOT NULL default '0',
nid int unsigned NOT NULL default '0',
vid int unsigned NOT NULL default '0',
tid int unsigned NOT NULL default '0',
PRIMARY KEY (vid),
KEY nid (nid),
KEY tid (tid)
......
......@@ -8,26 +8,26 @@ function locale_install() {
db_query("CREATE TABLE {locales_meta} (
locale varchar(12) NOT NULL default '',
name varchar(64) NOT NULL default '',
enabled int(2) NOT NULL default '0',
isdefault int(2) NOT NULL default '0',
plurals int(1) NOT NULL default '0',
enabled int NOT NULL default '0',
isdefault int NOT NULL default '0',
plurals int NOT NULL default '0',
formula varchar(128) NOT NULL default '',
PRIMARY KEY (locale)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {locales_source} (
lid int(11) NOT NULL auto_increment,
lid int NOT NULL auto_increment,
location varchar(255) NOT NULL default '',
source blob NOT NULL,
PRIMARY KEY (lid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {locales_target} (
lid int(11) NOT NULL default '0',
lid int NOT NULL default '0',
translation blob NOT NULL,
locale varchar(12) NOT NULL default '',
plid int(11) NOT NULL default '0',
plural int(1) NOT NULL default '0',
plid int NOT NULL default '0',
plural int NOT NULL default '0',
KEY lid (lid),
KEY lang (locale),
KEY plid (plid),
......
......@@ -6,16 +6,16 @@ function poll_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {poll} (
nid int(10) unsigned NOT NULL default '0',
runtime int(10) NOT NULL default '0',
active int(2) unsigned NOT NULL default '0',
nid int unsigned NOT NULL default '0',
runtime int NOT NULL default '0',
active int unsigned NOT NULL default '0',
PRIMARY KEY (nid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {poll_votes} (
nid int(10) unsigned NOT NULL,
uid int(10) unsigned NOT NULL default 0,
chorder int(10) NOT NULL default -1,
nid int unsigned NOT NULL,
uid int unsigned NOT NULL default 0,
chorder int NOT NULL default -1,
hostname varchar(128) NOT NULL default '',
INDEX (nid),
INDEX (uid),
......@@ -23,11 +23,11 @@ function poll_install() {
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {poll_choices} (
chid int(10) unsigned NOT NULL auto_increment,
nid int(10) unsigned NOT NULL default '0',
chid int unsigned NOT NULL auto_increment,
nid int unsigned NOT NULL default '0',
chtext varchar(128) NOT NULL default '',
chvotes int(6) NOT NULL default '0',
chorder int(2) NOT NULL default '0',
chvotes int NOT NULL default '0',
chorder int NOT NULL default '0',
PRIMARY KEY (chid),
KEY nid (nid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
......
......@@ -6,18 +6,18 @@ function profile_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {profile_fields} (
fid int(10) NOT NULL auto_increment,
fid int NOT NULL auto_increment,
title varchar(255) default NULL,
name varchar(128) default NULL,
explanation TEXT default NULL,
category varchar(255) default NULL,
page varchar(255) default NULL,
type varchar(128) default NULL,
weight tinyint(1) DEFAULT '0' NOT NULL,
required tinyint(1) DEFAULT '0' NOT NULL,
register tinyint(1) DEFAULT '0' NOT NULL,
visibility tinyint(1) DEFAULT '0' NOT NULL,
autocomplete tinyint(1) DEFAULT '0' NOT NULL,
weight tinyint DEFAULT '0' NOT NULL,
required tinyint DEFAULT '0' NOT NULL,
register tinyint DEFAULT '0' NOT NULL,
visibility tinyint DEFAULT '0' NOT NULL,
autocomplete tinyint DEFAULT '0' NOT NULL,
options text,
KEY category (category),
UNIQUE KEY name (name),
......@@ -25,8 +25,8 @@ function profile_install() {
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {profile_values} (
fid int(10) unsigned default '0',
uid int(10) unsigned default '0',
fid int unsigned default '0',
uid int unsigned default '0',
value text,
KEY uid (uid),
KEY fid (fid)
......
......@@ -6,7 +6,7 @@ function search_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {search_dataset} (
sid int(10) unsigned NOT NULL default '0',
sid int unsigned NOT NULL default '0',
type varchar(16) default NULL,
data longtext NOT NULL,
KEY sid_type (sid, type)
......@@ -14,9 +14,9 @@ function search_install() {
db_query("CREATE TABLE {search_index} (
word varchar(50) NOT NULL default '',
sid int(10) unsigned NOT NULL default '0',
sid int unsigned NOT NULL default '0',
type varchar(16) default NULL,
fromsid int(10) unsigned NOT NULL default '0',
fromsid int unsigned NOT NULL default '0',
fromtype varchar(16) default NULL,
score float default NULL,
KEY sid_type (sid, type),
......
......@@ -6,15 +6,15 @@ function statistics_install() {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE {accesslog} (
aid int(10) NOT NULL auto_increment,
aid int NOT NULL auto_increment,
sid varchar(32) NOT NULL default '',
title varchar(255) default NULL,
path varchar(255) default NULL,
url varchar(255) default NULL,
hostname varchar(128) default NULL,
uid int(10) unsigned default '0',
timer int(10) unsigned NOT NULL default '0',
timestamp int(11) unsigned NOT NULL default '0',
uid int unsigned default '0',
timer int unsigned NOT NULL default '0',
timestamp int unsigned NOT NULL default '0',
KEY accesslog_timestamp (timestamp),
PRIMARY KEY (aid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment