mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-23 09:53:09 +00:00
Part of fix for bug SF# 917560 (sub-community browse). Fix consists of addition
of a new table 'Communities2Item' which contains the entire mapping of parent communities to items (i.e. one row for each comm-item pair). This table is substituted in all the community-restricted views used in the browse: communityitembydate, communityitembyauthor, etc git-svn-id: http://scm.dspace.org/svn/repo/trunk@837 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -104,6 +104,7 @@ CREATE SEQUENCE registrationdata_seq;
|
|||||||
CREATE SEQUENCE subscription_seq;
|
CREATE SEQUENCE subscription_seq;
|
||||||
CREATE SEQUENCE history_seq;
|
CREATE SEQUENCE history_seq;
|
||||||
CREATE SEQUENCE historystate_seq;
|
CREATE SEQUENCE historystate_seq;
|
||||||
|
CREATE SEQUENCE communities2item_seq;
|
||||||
CREATE SEQUENCE itemsbyauthor_seq;
|
CREATE SEQUENCE itemsbyauthor_seq;
|
||||||
CREATE SEQUENCE itemsbytitle_seq;
|
CREATE SEQUENCE itemsbytitle_seq;
|
||||||
CREATE SEQUENCE itemsbydate_seq;
|
CREATE SEQUENCE itemsbydate_seq;
|
||||||
@@ -475,8 +476,18 @@ CREATE TABLE HistoryState
|
|||||||
------------------------------------------------------------
|
------------------------------------------------------------
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
-- Community2Item view
|
-- Communities2Item table
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
CREATE TABLE Communities2Item
|
||||||
|
(
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
community_id INTEGER REFERENCES Community(community_id),
|
||||||
|
item_id INTEGER REFERENCES Item(item_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
-------------------------------------------------------
|
||||||
|
-- Community2Item view
|
||||||
|
------------------------------------------------------
|
||||||
CREATE VIEW Community2Item as
|
CREATE VIEW Community2Item as
|
||||||
SELECT Community2Collection.community_id, Collection2Item.item_id
|
SELECT Community2Collection.community_id, Collection2Item.item_id
|
||||||
FROM Community2Collection, Collection2Item
|
FROM Community2Collection, Collection2Item
|
||||||
@@ -510,9 +521,9 @@ WHERE ItemsByAuthor.item_id = Collection2Item.item_id
|
|||||||
-- CommunityItemsByAuthor view
|
-- CommunityItemsByAuthor view
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
CREATE VIEW CommunityItemsByAuthor as
|
CREATE VIEW CommunityItemsByAuthor as
|
||||||
SELECT Community2Item.community_id, ItemsByAuthor.*
|
SELECT Communities2Item.community_id, ItemsByAuthor.*
|
||||||
FROM ItemsByAuthor, Community2Item
|
FROM ItemsByAuthor, Communities2Item
|
||||||
WHERE ItemsByAuthor.item_id = Community2Item.item_id
|
WHERE ItemsByAuthor.item_id = Communities2Item.item_id
|
||||||
;
|
;
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
@@ -543,9 +554,9 @@ WHERE ItemsByTitle.item_id = Collection2Item.item_id
|
|||||||
-- CommunityItemsByTitle view
|
-- CommunityItemsByTitle view
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
CREATE VIEW CommunityItemsByTitle as
|
CREATE VIEW CommunityItemsByTitle as
|
||||||
SELECT Community2Item.community_id, ItemsByTitle.*
|
SELECT Communities2Item.community_id, ItemsByTitle.*
|
||||||
FROM ItemsByTitle, Community2Item
|
FROM ItemsByTitle, Communities2Item
|
||||||
WHERE ItemsByTitle.item_id = Community2Item.item_id
|
WHERE ItemsByTitle.item_id = Communities2Item.item_id
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -574,9 +585,9 @@ WHERE ItemsByDate.item_id = Collection2Item.item_id
|
|||||||
-- CommunityItemsByDate view
|
-- CommunityItemsByDate view
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
CREATE VIEW CommunityItemsByDate as
|
CREATE VIEW CommunityItemsByDate as
|
||||||
SELECT Community2Item.community_id, ItemsByDate.*
|
SELECT Communities2Item.community_id, ItemsByDate.*
|
||||||
FROM ItemsByDate, Community2Item
|
FROM ItemsByDate, Communities2Item
|
||||||
WHERE ItemsByDate.item_id = Community2Item.item_id
|
WHERE ItemsByDate.item_id = Communities2Item.item_id
|
||||||
;
|
;
|
||||||
|
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
@@ -602,9 +613,9 @@ WHERE ItemsByDateAccessioned.item_id = Collection2Item.item_id
|
|||||||
-- CommunityItemsByDateAccession view
|
-- CommunityItemsByDateAccession view
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
CREATE VIEW CommunityItemsByDateAccession as
|
CREATE VIEW CommunityItemsByDateAccession as
|
||||||
SELECT Community2Item.community_id, ItemsByDateAccessioned.*
|
SELECT Communities2Item.community_id, ItemsByDateAccessioned.*
|
||||||
FROM ItemsByDateAccessioned, Community2Item
|
FROM ItemsByDateAccessioned, Communities2Item
|
||||||
WHERE ItemsByDateAccessioned.item_id = Community2Item.item_id
|
WHERE ItemsByDateAccessioned.item_id = Communities2Item.item_id
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user