forked from colin-combe/xiView_container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
311 lines (229 loc) · 6.56 KB
/
schema.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.9
-- Dumped by pg_dump version 9.6.9
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
--
-- Name: make_uid(); Type: FUNCTION; Schema: public; Owner: username
--
CREATE FUNCTION public.make_uid() RETURNS text
LANGUAGE plpgsql
AS $$
BEGIN
return CAST( '' || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10)
|| '-' || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10)
|| '-' || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10)
|| '-' || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10) || trunc(random()*10)
AS varchar);
END;
$$;
ALTER FUNCTION public.make_uid() OWNER TO username;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: db_sequences; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.db_sequences (
id text,
upload_id integer,
accession text,
protein_name text,
description text,
sequence text,
is_decoy boolean
);
ALTER TABLE public.db_sequences OWNER TO username;
--
-- Name: modifications; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.modifications (
id bigint,
upload_id integer,
mod_name text,
mass double precision,
residues text,
accession text
);
ALTER TABLE public.modifications OWNER TO username;
--
-- Name: peptide_evidences; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.peptide_evidences (
upload_id integer,
peptide_ref text,
dbsequence_ref text,
protein_accession text,
pep_start integer,
is_decoy integer
);
ALTER TABLE public.peptide_evidences OWNER TO username;
--
-- Name: peptides; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.peptides (
id text,
upload_id integer,
seq_mods text,
link_site integer,
crosslinker_modmass double precision,
crosslinker_pair_id bigint
);
ALTER TABLE public.peptides OWNER TO username;
--
-- Name: protocols; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.protocols (
id text NOT NULL,
upload_id integer,
protocol json,
ms2_tol double precision
);
ALTER TABLE public.protocols OWNER TO username;
--
-- Name: spectra; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.spectra (
id bigint,
upload_id integer,
peak_list text,
peak_list_file_name text,
scan_id text,
frag_tol text,
spectrum_ref text
);
ALTER TABLE public.spectra OWNER TO username;
--
-- Name: spectrum_identifications; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.spectrum_identifications (
id bigint,
upload_id integer,
spectrum_id bigint,
pep1_id text,
pep2_id text,
charge_state integer,
pass_threshold boolean,
rank integer,
ions text,
scores json,
exp_mz double precision,
calc_mz double precision
);
ALTER TABLE public.spectrum_identifications OWNER TO username;
--
-- Name: uploads; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.uploads (
id integer NOT NULL,
user_id integer,
filename text,
peak_list_file_names json,
analysis_software json,
provider json,
audits json,
samples json,
analyses json,
protocol json,
bib json,
spectra_formats json,
upload_time date,
default_pdb text,
contains_crosslinks boolean,
upload_error text,
error_type text,
upload_warnings json,
origin text,
random_id character varying DEFAULT public.make_uid()
);
ALTER TABLE public.uploads OWNER TO username;
--
-- Name: uploads_id_seq; Type: SEQUENCE; Schema: public; Owner: username
--
CREATE SEQUENCE public.uploads_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.uploads_id_seq OWNER TO username;
--
-- Name: uploads_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: username
--
ALTER SEQUENCE public.uploads_id_seq OWNED BY public.uploads.id;
--
-- Name: user_in_group; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.user_in_group (
user_id integer,
group_id integer
);
ALTER TABLE public.user_in_group OWNER TO username;
--
-- Name: users; Type: TABLE; Schema: public; Owner: username
--
CREATE TABLE public.users (
user_name character varying,
password character varying,
email character varying,
max_aas integer,
max_spectra integer,
gdpr_token character varying,
id integer NOT NULL,
gdpr_timestamp time without time zone,
ptoken character varying,
ptoken_timestamp character varying,
hidden boolean
);
ALTER TABLE public.users OWNER TO username;
--
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: username
--
CREATE SEQUENCE public.users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.users_id_seq OWNER TO username;
--
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: username
--
ALTER SEQUENCE public.users_id_seq OWNED BY public.users.id;
--
-- Name: uploads id; Type: DEFAULT; Schema: public; Owner: username
--
ALTER TABLE ONLY public.uploads ALTER COLUMN id SET DEFAULT nextval('public.uploads_id_seq'::regclass);
--
-- Name: users id; Type: DEFAULT; Schema: public; Owner: username
--
ALTER TABLE ONLY public.users ALTER COLUMN id SET DEFAULT nextval('public.users_id_seq'::regclass);
--
-- Name: protocols protocols_pkey; Type: CONSTRAINT; Schema: public; Owner: username
--
ALTER TABLE ONLY public.protocols
ADD CONSTRAINT protocols_pkey PRIMARY KEY (id);
--
-- Name: uploads uploads_pkey; Type: CONSTRAINT; Schema: public; Owner: username
--
ALTER TABLE ONLY public.uploads
ADD CONSTRAINT uploads_pkey PRIMARY KEY (id);
--
-- PostgreSQL database dump complete
--