Merge branch 'DS-824' of https://github.com/DSpace/DSpace into DS-824

This commit is contained in:
Andrea Bollini
2013-10-22 01:01:56 +02:00
5 changed files with 75 additions and 14 deletions

View File

@@ -134,4 +134,4 @@ DROP SEQUENCE versionhistory_seq;
DROP SEQUENCE versionitem_seq;
-- Drop the getnextid() function
DROP FUNCTION getnextid(VARCHAR(40));
DROP FUNCTION getnextid;

View File

@@ -18,7 +18,7 @@ browse code - LIMIT and OFFSET is used to limit browse results, and an
Oracle-hack is used to limit the result set to a given size
Oracle has no boolean data type, so a new schema file was created that
uses INTEGERs and code is inserted everywhere to use 0 for false
uses NUMBER(1) (AKA 'integers') and code is inserted everywhere to use 0 for false
and 1 for true if the db.name is Oracle
Oracle doesn't have a TEXT data type either, so TEXT columns are defined

View File

@@ -74,6 +74,7 @@ CREATE SEQUENCE harvested_item_seq;
CREATE SEQUENCE versionitem_seq;
CREATE SEQUENCE versionhistory_seq;
CREATE SEQUENCE webapp_seq;
CREATE SEQUENCE requestitem_seq;
-------------------------------------------------------
-- BitstreamFormatRegistry table
@@ -772,8 +773,26 @@ CREATE TABLE versionitem
CREATE TABLE Webapp
(
webapp_id INTEGER NOT NULL PRIMARY KEY,
AppName VARCHAR(32),
URL VARCHAR,
AppName VARCHAR2(32),
URL VARCHAR2(1000),
Started TIMESTAMP,
isUI INTEGER
isUI NUMBER(1)
);
CREATE TABLE requestitem
(
requestitem_id INTEGER NOT NULL,
token varchar(48),
item_id INTEGER,
bitstream_id INTEGER,
allfiles NUMBER(1),
request_email VARCHAR2(64),
request_name VARCHAR2(64),
request_date TIMESTAMP,
accept_request NUMBER(1),
decision_date TIMESTAMP,
expires TIMESTAMP,
CONSTRAINT requestitem_pkey PRIMARY KEY (requestitem_id),
CONSTRAINT requestitem_token_key UNIQUE (token)
);

View File

@@ -1,5 +1,5 @@
--
-- database_schema_18-3.sql
-- database_schema_3-4.sql
--
-- Version: $Revision$
--
@@ -13,8 +13,8 @@
--
--
-- SQL commands to upgrade the database schema of a live DSpace 1.8 or 1.8.x
-- to the DSpace 3 database schema
-- SQL commands to upgrade the database schema of a live DSpace 3.0 or 3.x
-- to the DSpace 4 database schema
--
-- DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST.
-- DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST.
@@ -24,7 +24,6 @@
-------------------------------------------
-- Add support for DOIs (table and seq.) --
-------------------------------------------
CREATE SEQUENCE doi_seq;
CREATE TABLE Doi
(
@@ -35,6 +34,8 @@ CREATE TABLE Doi
status INTEGER
);
CREATE SEQUENCE doi_seq;
-- index by resource id and resource type id
CREATE INDEX doi_resource_id_type_idx ON doi(resource_id, resource_type_id);
@@ -42,13 +43,36 @@ CREATE INDEX doi_resource_id_type_idx ON doi(resource_id, resource_type_id);
-- Table of running web applications for 'dspace version' --
-------------------------------------------
CREATE SEQUENCE webapp_seq;
CREATE TABLE Webapp
(
webapp_id INTEGER NOT NULL PRIMARY KEY,
AppName VARCHAR(32),
URL VARCHAR,
AppName VARCHAR2(32),
URL VARCHAR2,
Started TIMESTAMP,
isUI INTEGER
isUI NUMBER(1)
);
CREATE SEQUENCE webapp_seq;
-------------------------------------------------------
-- DS-824 RequestItem table
-------------------------------------------------------
CREATE TABLE requestitem
(
requestitem_id INTEGER NOT NULL,
token varchar(48),
item_id INDEX,
bitstream_id INTEGER,
allfiles NUMBER(1),
request_email VARCHAR2(64),
request_name VARCHAR2(64),
request_date TIMESTAMP,
accept_request NUMBER(1),
decision_date TIMESTAMP,
expires TIMESTAMP,
CONSTRAINT requestitem_pkey PRIMARY KEY (requestitem_id),
CONSTRAINT requestitem_token_key UNIQUE (token)
);
CREATE SEQUENCE requestitem_seq;

View File

@@ -111,6 +111,7 @@ CREATE SEQUENCE harvested_item_seq;
CREATE SEQUENCE versionitem_seq;
CREATE SEQUENCE versionhistory_seq;
CREATE SEQUENCE webapp_seq;
CREATE SEQUENCE requestitem_seq;
-------------------------------------------------------
-- BitstreamFormatRegistry table
@@ -825,3 +826,20 @@ CREATE TABLE Webapp
Started TIMESTAMP,
isUI INTEGER
);
CREATE TABLE requestitem
(
requestitem_id int4 NOT NULL,
token varchar(48),
item_id int4,
bitstream_id int4,
allfiles bool,
request_email varchar(64),
request_name varchar(64),
request_date timestamp,
accept_request bool,
decision_date timestamp,
expires timestamp,
CONSTRAINT requestitem_pkey PRIMARY KEY (requestitem_id),
CONSTRAINT requestitem_token_key UNIQUE (token)
);