Commit 88723451 authored by Dries's avatar Dries
Browse files

- Patch #62478 by Matt: database schema cleanup.

parent b28ce3b0
......@@ -412,17 +412,18 @@ CREATE TABLE node (
promote int(2) NOT NULL default '0',
moderate int(2) NOT NULL default '0',
sticky int(2) NOT NULL default '0',
PRIMARY KEY (nid),
PRIMARY KEY (nid, vid),
UNIQUE KEY vid (vid),
KEY node_type (type(4)),
KEY node_title_type (title,type(4)),
KEY node_title_type (title, type(4)),
KEY status (status),
KEY uid (uid),
KEY vid (vid),
KEY node_moderate (moderate),
KEY node_promote_status (promote, status),
KEY node_created (created),
KEY node_changed (changed),
KEY node_status_type (status, type, nid)
KEY node_status_type (status, type, nid),
KEY nid (nid)
);
--
......@@ -634,7 +635,7 @@ CREATE TABLE sequences (
--
CREATE TABLE node_counter (
nid int(11) NOT NULL default '0',
nid int(10) NOT NULL default '0',
totalcount bigint(20) unsigned NOT NULL default '0',
daycount mediumint(8) unsigned NOT NULL default '0',
timestamp int(11) unsigned NOT NULL default '0',
......
......@@ -440,17 +440,18 @@ CREATE TABLE node (
promote int(2) NOT NULL default '0',
moderate int(2) NOT NULL default '0',
sticky int(2) NOT NULL default '0',
PRIMARY KEY (nid),
PRIMARY KEY (nid, vid),
UNIQUE KEY vid (vid),
KEY node_type (type(4)),
KEY node_title_type (title,type(4)),
KEY node_title_type (title, type(4)),
KEY status (status),
KEY uid (uid),
KEY vid (vid),
KEY node_moderate (moderate),
KEY node_promote_status (promote, status),
KEY node_created (created),
KEY node_changed (changed),
KEY node_status_type (status, type, nid)
KEY node_status_type (status, type, nid),
KEY nid (nid)
)
DEFAULT CHARACTER SET utf8;
......@@ -678,7 +679,7 @@ DEFAULT CHARACTER SET utf8;
--
CREATE TABLE node_counter (
nid int(11) NOT NULL default '0',
nid int(10) NOT NULL default '0',
totalcount bigint(20) unsigned NOT NULL default '0',
daycount mediumint(8) unsigned NOT NULL default '0',
timestamp int(11) unsigned NOT NULL default '0',
......
......@@ -1954,3 +1954,22 @@ function system_update_179() {
return array();
}
function system_update_180() {
$ret = array();
if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql("ALTER TABLE {node} DROP PRIMARY KEY");
$ret[] = update_sql("ALTER TABLE {node} ADD PRIMARY KEY (nid, vid)");
$ret[] = update_sql("ALTER TABLE {node} DROP INDEX vid");
$ret[] = update_sql("ALTER TABLE {node} ADD UNIQUE (vid)");
$ret[] = update_sql("ALTER TABLE {node} ADD INDEX (nid)");
$ret[] = update_sql("ALTER TABLE {node_counter} CHANGE nid nid INT(10) NOT NULL DEFAULT '0'");
}
else { // pgsql
// Insert queries here.
}
return $ret;
}
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