Ensure item_count tables are correctly defined, including primary keys

git-svn-id: http://scm.dspace.org/svn/repo/trunk@2625 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Graham Triggs
2008-02-09 22:48:17 +00:00
parent e894a2875d
commit ad0851eddd
4 changed files with 20 additions and 6 deletions

View File

@@ -573,12 +573,12 @@ WHERE Collection2Item.collection_id = Community2Collection.collection_id
-------------------------------------------------------------------------
CREATE TABLE collection_item_count (
collection_id INTEGER REFERENCES collection(collection_id),
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
count INTEGER
);
CREATE TABLE community_item_count (
community_id INTEGER REFERENCES community(community_id),
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
count INTEGER
);

View File

@@ -67,12 +67,12 @@ ALTER TABLE workspaceitem ADD page_reached INTEGER;
-------------------------------------------------------------------------
CREATE TABLE collection_item_count (
collection_id INTEGER REFERENCES collection(collection_id),
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
count INTEGER
);
CREATE TABLE community_item_count (
community_id INTEGER REFERENCES community(community_id),
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
count INTEGER
);

View File

@@ -523,6 +523,20 @@ WHERE Collection2Item.collection_id = Community2Collection.collection_id
-- Indexing browse tables update/re-index performance
CREATE INDEX Communities2Item_item_id_idx ON Communities2Item( item_id );
-------------------------------------------------------------------------
-- Tables to manage cache of item counts for communities and collections
-------------------------------------------------------------------------
CREATE TABLE collection_item_count (
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
count INTEGER
);
CREATE TABLE community_item_count (
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
count INTEGER
);
-------------------------------------------------------
-- Create 'special' groups, for anonymous access
-- and administrators

View File

@@ -70,12 +70,12 @@ ALTER TABLE workspaceitem ADD page_reached INTEGER;
-------------------------------------------------------------------------
CREATE TABLE collection_item_count (
collection_id INTEGER REFERENCES collection(collection_id),
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
count INTEGER
);
CREATE TABLE community_item_count (
community_id INTEGER REFERENCES community(community_id),
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
count INTEGER
);