Commit ceb346b7 authored by drumm's avatar drumm
Browse files

#70504 by pwolanin. Add key on {files}.nid.

parent dca26f5e
......@@ -236,7 +236,8 @@ function system_install() {
filepath varchar(255) NOT NULL default '',
filemime varchar(255) NOT NULL default '',
filesize int unsigned NOT NULL default 0,
PRIMARY KEY (fid)
PRIMARY KEY (fid),
KEY nid (nid)
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {file_revisions} (
......@@ -702,6 +703,7 @@ function system_install() {
filesize int_unsigned NOT NULL default 0,
PRIMARY KEY (fid)
)");
db_query("CREATE INDEX {files}_nid_idx ON {files} (nid)");
db_query("CREATE TABLE {file_revisions} (
fid int_unsigned NOT NULL default 0,
......@@ -3296,9 +3298,11 @@ function system_update_1012() {
case 'mysql':
case 'mysqli':
$ret[] = update_sql("ALTER TABLE {file_revisions} ADD INDEX(vid)");
$ret[] = update_sql("ALTER TABLE {files} ADD INDEX(nid)");
break;
case 'pgsql':
$ret[] = update_sql('CREATE INDEX {file_revisions}_vid_idx ON {file_revisions} (vid)');
$ret[] = update_sql('CREATE INDEX {files}_nid_idx ON {files} (nid)');
break;
}
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