diff options
author | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-30 02:19:38 +0000 |
---|---|---|
committer | Neil Drumm <drumm@3064.no-reply.drupal.org> | 2006-11-30 02:19:38 +0000 |
commit | ceb346b7414abc6e85d195b32546a351726d1360 (patch) | |
tree | 5e71809fbdde1132cee9573be5de399161f4929b | |
parent | dca26f5ebd415fd88b7d49f6eaa7c3dd7cfa4c1e (diff) | |
download | brdo-ceb346b7414abc6e85d195b32546a351726d1360.tar.gz brdo-ceb346b7414abc6e85d195b32546a351726d1360.tar.bz2 |
#70504 by pwolanin. Add key on {files}.nid.
-rw-r--r-- | modules/system/system.install | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index caafe15ca..ec98d7fdc 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -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; |