#70504 by pwolanin. Add key on {files}.nid.
parent
dca26f5ebd
commit
ceb346b741
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue