-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
database_schema_3-4.sql
95 lines (81 loc) · 2.9 KB
/
database_schema_3-4.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
--
-- database_schema_3-4.sql
--
-- Version: $Revision$
--
-- Date: $Date: 2012-05-29
--
-- The contents of this file are subject to the license and copyright
-- detailed in the LICENSE and NOTICE files at the root of the source
-- tree and available online at
--
-- http://www.dspace.org/license/
--
--
-- 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.
-- DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST. DUMP YOUR DATABASE FIRST.
--
-------------------------------------------
-- Ensure that discoverable has a sensible default
-------------------------------------------
update item set discoverable=1 WHERE discoverable IS NULL;
-------------------------------------------
-- Add support for DOIs (table and seq.) --
-------------------------------------------
CREATE TABLE Doi
(
doi_id INTEGER PRIMARY KEY,
doi VARCHAR2(256) UNIQUE,
resource_type_id INTEGER,
resource_id INTEGER,
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);
-------------------------------------------
-- Table of running web applications for 'dspace version' --
-------------------------------------------
CREATE TABLE Webapp
(
webapp_id INTEGER NOT NULL PRIMARY KEY,
AppName VARCHAR2(32),
URL VARCHAR2(1000),
Started TIMESTAMP,
isUI NUMBER(1)
);
CREATE SEQUENCE webapp_seq;
-------------------------------------------------------
-- DS-824 RequestItem table
-------------------------------------------------------
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)
);
CREATE SEQUENCE requestitem_seq;
-------------------------------------------------------
-- DS-1655 Disable "Initial Questions" page in Submission UI by default
-------------------------------------------------------
update workspaceitem set multiple_titles=1, published_before=1, multiple_files=1;
update workflowitem set multiple_titles=1, published_before=1, multiple_files=1;
-------------------------------------------------------
-- DS-1811 Removing a collection fails if non-Solr DAO has been used before for item count
-------------------------------------------------------
delete from collection_item_count;
delete from community_item_count;