mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
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:
@@ -573,12 +573,12 @@ WHERE Collection2Item.collection_id = Community2Collection.collection_id
|
|||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
CREATE TABLE collection_item_count (
|
CREATE TABLE collection_item_count (
|
||||||
collection_id INTEGER REFERENCES collection(collection_id),
|
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
|
||||||
count INTEGER
|
count INTEGER
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE community_item_count (
|
CREATE TABLE community_item_count (
|
||||||
community_id INTEGER REFERENCES community(community_id),
|
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
|
||||||
count INTEGER
|
count INTEGER
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -67,12 +67,12 @@ ALTER TABLE workspaceitem ADD page_reached INTEGER;
|
|||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
CREATE TABLE collection_item_count (
|
CREATE TABLE collection_item_count (
|
||||||
collection_id INTEGER REFERENCES collection(collection_id),
|
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
|
||||||
count INTEGER
|
count INTEGER
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE community_item_count (
|
CREATE TABLE community_item_count (
|
||||||
community_id INTEGER REFERENCES community(community_id),
|
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
|
||||||
count INTEGER
|
count INTEGER
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -523,6 +523,20 @@ WHERE Collection2Item.collection_id = Community2Collection.collection_id
|
|||||||
-- Indexing browse tables update/re-index performance
|
-- Indexing browse tables update/re-index performance
|
||||||
CREATE INDEX Communities2Item_item_id_idx ON Communities2Item( item_id );
|
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
|
-- Create 'special' groups, for anonymous access
|
||||||
-- and administrators
|
-- and administrators
|
||||||
|
@@ -70,12 +70,12 @@ ALTER TABLE workspaceitem ADD page_reached INTEGER;
|
|||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
CREATE TABLE collection_item_count (
|
CREATE TABLE collection_item_count (
|
||||||
collection_id INTEGER REFERENCES collection(collection_id),
|
collection_id INTEGER PRIMARY KEY REFERENCES collection(collection_id),
|
||||||
count INTEGER
|
count INTEGER
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE community_item_count (
|
CREATE TABLE community_item_count (
|
||||||
community_id INTEGER REFERENCES community(community_id),
|
community_id INTEGER PRIMARY KEY REFERENCES community(community_id),
|
||||||
count INTEGER
|
count INTEGER
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user