2 -- PostgreSQL database dump
5 -- Dumped from database version 12.4 (Debian 12.4-1.pgdg100+1)
6 -- Dumped by pg_dump version 12.4 (Debian 12.4-1.pgdg100+1)
8 SET statement_timeout = 0;
10 SET idle_in_transaction_session_timeout = 0;
11 SET client_encoding = 'UTF8';
12 SET standard_conforming_strings = on;
13 SELECT pg_catalog.set_config('search_path', '', false);
14 SET check_function_bodies = false;
15 SET xmloption = content;
16 SET client_min_messages = warning;
17 SET row_security = off;
20 -- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
23 CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
27 -- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner:
30 COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
33 SET default_tablespace = '';
35 SET default_table_access_method = heap;
38 -- Name: compound; Type: TABLE; Schema: public; Owner: postgres
41 CREATE TABLE public.compound (
42 compound_id integer NOT NULL,
44 smid_id character varying(100) NOT NULL,
45 curation_status character varying(100),
48 last_curated_time timestamp without time zone,
49 create_date timestamp without time zone,
50 last_modified_date timestamp without time zone,
51 iupac_name text NOT NULL,
60 ALTER TABLE public.compound OWNER TO postgres;
63 -- Name: compound_compound_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
66 CREATE SEQUENCE public.compound_compound_id_seq
75 ALTER TABLE public.compound_compound_id_seq OWNER TO postgres;
78 -- Name: compound_compound_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
81 ALTER SEQUENCE public.compound_compound_id_seq OWNED BY public.compound.compound_id;
85 -- Name: compound_dbxref; Type: TABLE; Schema: public; Owner: postgres
88 CREATE TABLE public.compound_dbxref (
89 compound_dbxref_id integer NOT NULL,
93 curation_status character varying(100),
95 last_curatated_time timestamp without time zone
99 ALTER TABLE public.compound_dbxref OWNER TO postgres;
102 -- Name: compound_dbxref_compound_dbxref_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
105 CREATE SEQUENCE public.compound_dbxref_compound_dbxref_id_seq
114 ALTER TABLE public.compound_dbxref_compound_dbxref_id_seq OWNER TO postgres;
117 -- Name: compound_dbxref_compound_dbxref_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
120 ALTER SEQUENCE public.compound_dbxref_compound_dbxref_id_seq OWNED BY public.compound_dbxref.compound_dbxref_id;
124 -- Name: compound_image; Type: TABLE; Schema: public; Owner: postgres
127 CREATE TABLE public.compound_image (
128 compound_image_id integer NOT NULL,
132 last_curated_time timestamp without time zone,
133 curation_status character varying(100)
137 ALTER TABLE public.compound_image OWNER TO postgres;
140 -- Name: compound_image_compound_image_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
143 CREATE SEQUENCE public.compound_image_compound_image_id_seq
152 ALTER TABLE public.compound_image_compound_image_id_seq OWNER TO postgres;
155 -- Name: compound_image_compound_image_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
158 ALTER SEQUENCE public.compound_image_compound_image_id_seq OWNED BY public.compound_image.compound_image_id;
162 -- Name: db; Type: TABLE; Schema: public; Owner: postgres
165 CREATE TABLE public.db (
166 db_id integer NOT NULL,
167 name character varying(255),
168 description character varying(255),
169 urlprefix character varying(255),
170 url character varying(255)
174 ALTER TABLE public.db OWNER TO postgres;
177 -- Name: db_db_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
180 CREATE SEQUENCE public.db_db_id_seq
189 ALTER TABLE public.db_db_id_seq OWNER TO postgres;
192 -- Name: db_db_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
195 ALTER SEQUENCE public.db_db_id_seq OWNED BY public.db.db_id;
199 -- Name: dbuser; Type: TABLE; Schema: public; Owner: postgres
202 CREATE TABLE public.dbuser (
203 dbuser_id integer NOT NULL,
204 username character varying(100),
206 first_name character varying(100),
207 last_name character varying(100),
208 organization character varying(100),
210 phone_number character varying(100),
211 email character varying(100),
212 registration_email character varying(100),
214 disabled character varying(100),
215 last_access_time timestamp without time zone,
216 user_type character varying(100),
217 creation_date timestamp without time zone,
218 last_modified_date timestamp without time zone,
219 user_prefs character varying(255)
223 ALTER TABLE public.dbuser OWNER TO postgres;
226 -- Name: dbuser_dbuser_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
229 CREATE SEQUENCE public.dbuser_dbuser_id_seq
238 ALTER TABLE public.dbuser_dbuser_id_seq OWNER TO postgres;
241 -- Name: dbuser_dbuser_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
244 ALTER SEQUENCE public.dbuser_dbuser_id_seq OWNED BY public.dbuser.dbuser_id;
248 -- Name: dbxref; Type: TABLE; Schema: public; Owner: postgres
251 CREATE TABLE public.dbxref (
252 dbxref_id integer NOT NULL,
254 accession character varying(255),
255 version character varying(255),
261 ALTER TABLE public.dbxref OWNER TO postgres;
264 -- Name: dbxref_dbxref_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
267 CREATE SEQUENCE public.dbxref_dbxref_id_seq
276 ALTER TABLE public.dbxref_dbxref_id_seq OWNER TO postgres;
279 -- Name: dbxref_dbxref_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
282 ALTER SEQUENCE public.dbxref_dbxref_id_seq OWNED BY public.dbxref.dbxref_id;
286 -- Name: experiment; Type: TABLE; Schema: public; Owner: postgres
289 CREATE TABLE public.experiment (
290 experiment_id integer NOT NULL,
291 name character varying(100),
294 experiment_type character varying(100),
295 run_date timestamp without time zone,
296 create_date timestamp without time zone,
298 operator character varying(100),
300 compound_id bigint NOT NULL,
301 curation_status character varying(100),
303 last_curatated_time timestamp without time zone
307 ALTER TABLE public.experiment OWNER TO postgres;
310 -- Name: experiment_experiment_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
313 CREATE SEQUENCE public.experiment_experiment_id_seq
322 ALTER TABLE public.experiment_experiment_id_seq OWNER TO postgres;
325 -- Name: experiment_experiment_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
328 ALTER SEQUENCE public.experiment_experiment_id_seq OWNED BY public.experiment.experiment_id;
332 -- Name: image; Type: TABLE; Schema: public; Owner: postgres
335 CREATE TABLE public.image (
336 image_id integer NOT NULL,
337 image_location character varying(200),
338 name character varying(100),
340 type character varying(20),
343 obsolete boolean DEFAULT false,
344 file_ext character varying(20),
345 original_filename character varying(255),
346 md5sum character varying(100),
347 image_taken_timestamp timestamp without time zone,
348 create_date timestamp without time zone,
349 modified_date timestamp without time zone DEFAULT now(),
350 curation_status character varying(20) DEFAULT 'unverified'::character varying,
351 last_curated_time timestamp without time zone,
356 ALTER TABLE public.image OWNER TO postgres;
359 -- Name: image_image_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
362 CREATE SEQUENCE public.image_image_id_seq
371 ALTER TABLE public.image_image_id_seq OWNER TO postgres;
374 -- Name: image_image_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
377 ALTER SEQUENCE public.image_image_id_seq OWNED BY public.image.image_id;
381 -- Name: result; Type: TABLE; Schema: public; Owner: postgres
384 CREATE TABLE public.result (
385 result_id integer NOT NULL,
386 name character varying(100),
391 create_date timestamp without time zone,
392 modified_date timestamp without time zone,
393 method_type character varying(100) NOT NULL
397 ALTER TABLE public.result OWNER TO postgres;
400 -- Name: result_result_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
403 CREATE SEQUENCE public.result_result_id_seq
412 ALTER TABLE public.result_result_id_seq OWNER TO postgres;
415 -- Name: result_result_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
418 ALTER SEQUENCE public.result_result_id_seq OWNED BY public.result.result_id;
422 -- Name: compound compound_id; Type: DEFAULT; Schema: public; Owner: postgres
425 ALTER TABLE ONLY public.compound ALTER COLUMN compound_id SET DEFAULT nextval('public.compound_compound_id_seq'::regclass);
429 -- Name: compound_dbxref compound_dbxref_id; Type: DEFAULT; Schema: public; Owner: postgres
432 ALTER TABLE ONLY public.compound_dbxref ALTER COLUMN compound_dbxref_id SET DEFAULT nextval('public.compound_dbxref_compound_dbxref_id_seq'::regclass);
436 -- Name: compound_image compound_image_id; Type: DEFAULT; Schema: public; Owner: postgres
439 ALTER TABLE ONLY public.compound_image ALTER COLUMN compound_image_id SET DEFAULT nextval('public.compound_image_compound_image_id_seq'::regclass);
443 -- Name: db db_id; Type: DEFAULT; Schema: public; Owner: postgres
446 ALTER TABLE ONLY public.db ALTER COLUMN db_id SET DEFAULT nextval('public.db_db_id_seq'::regclass);
450 -- Name: dbuser dbuser_id; Type: DEFAULT; Schema: public; Owner: postgres
453 ALTER TABLE ONLY public.dbuser ALTER COLUMN dbuser_id SET DEFAULT nextval('public.dbuser_dbuser_id_seq'::regclass);
457 -- Name: dbxref dbxref_id; Type: DEFAULT; Schema: public; Owner: postgres
460 ALTER TABLE ONLY public.dbxref ALTER COLUMN dbxref_id SET DEFAULT nextval('public.dbxref_dbxref_id_seq'::regclass);
464 -- Name: experiment experiment_id; Type: DEFAULT; Schema: public; Owner: postgres
467 ALTER TABLE ONLY public.experiment ALTER COLUMN experiment_id SET DEFAULT nextval('public.experiment_experiment_id_seq'::regclass);
471 -- Name: image image_id; Type: DEFAULT; Schema: public; Owner: postgres
474 ALTER TABLE ONLY public.image ALTER COLUMN image_id SET DEFAULT nextval('public.image_image_id_seq'::regclass);
478 -- Name: result result_id; Type: DEFAULT; Schema: public; Owner: postgres
481 ALTER TABLE ONLY public.result ALTER COLUMN result_id SET DEFAULT nextval('public.result_result_id_seq'::regclass);
485 -- Name: compound_dbxref compound_dbxref_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
488 ALTER TABLE ONLY public.compound_dbxref
489 ADD CONSTRAINT compound_dbxref_pkey PRIMARY KEY (compound_dbxref_id);
493 -- Name: compound_image compound_image_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
496 ALTER TABLE ONLY public.compound_image
497 ADD CONSTRAINT compound_image_pkey PRIMARY KEY (compound_image_id);
501 -- Name: compound compound_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
504 ALTER TABLE ONLY public.compound
505 ADD CONSTRAINT compound_pkey PRIMARY KEY (compound_id);
509 -- Name: compound compound_smid_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
512 ALTER TABLE ONLY public.compound
513 ADD CONSTRAINT compound_smid_id_key UNIQUE (smid_id);
517 -- Name: db db_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
520 ALTER TABLE ONLY public.db
521 ADD CONSTRAINT db_pkey PRIMARY KEY (db_id);
525 -- Name: dbuser dbuser_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
528 ALTER TABLE ONLY public.dbuser
529 ADD CONSTRAINT dbuser_pkey PRIMARY KEY (dbuser_id);
533 -- Name: dbxref dbxref_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
536 ALTER TABLE ONLY public.dbxref
537 ADD CONSTRAINT dbxref_pkey PRIMARY KEY (dbxref_id);
541 -- Name: experiment experiment_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
544 ALTER TABLE ONLY public.experiment
545 ADD CONSTRAINT experiment_pkey PRIMARY KEY (experiment_id);
549 -- Name: image image_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
552 ALTER TABLE ONLY public.image
553 ADD CONSTRAINT image_pkey PRIMARY KEY (image_id);
557 -- Name: result result_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
560 ALTER TABLE ONLY public.result
561 ADD CONSTRAINT result_pkey PRIMARY KEY (result_id);
565 -- Name: compound compound_curator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
568 ALTER TABLE ONLY public.compound
569 ADD CONSTRAINT compound_curator_id_fkey FOREIGN KEY (curator_id) REFERENCES public.dbuser(dbuser_id);
573 -- Name: compound compound_dbuser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
576 ALTER TABLE ONLY public.compound
577 ADD CONSTRAINT compound_dbuser_id_fkey FOREIGN KEY (dbuser_id) REFERENCES public.dbuser(dbuser_id);
581 -- Name: compound_dbxref compound_dbxref_compound_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
584 ALTER TABLE ONLY public.compound_dbxref
585 ADD CONSTRAINT compound_dbxref_compound_id_fkey FOREIGN KEY (compound_id) REFERENCES public.compound(compound_id);
589 -- Name: compound_dbxref compound_dbxref_curator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
592 ALTER TABLE ONLY public.compound_dbxref
593 ADD CONSTRAINT compound_dbxref_curator_id_fkey FOREIGN KEY (curator_id) REFERENCES public.dbuser(dbuser_id);
597 -- Name: compound_dbxref compound_dbxref_dbuser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
600 ALTER TABLE ONLY public.compound_dbxref
601 ADD CONSTRAINT compound_dbxref_dbuser_id_fkey FOREIGN KEY (dbuser_id) REFERENCES public.dbuser(dbuser_id);
605 -- Name: compound_dbxref compound_dbxref_dbxref_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
608 ALTER TABLE ONLY public.compound_dbxref
609 ADD CONSTRAINT compound_dbxref_dbxref_id_fkey FOREIGN KEY (dbxref_id) REFERENCES public.dbxref(dbxref_id);
613 -- Name: compound_image compound_image_compound_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
616 ALTER TABLE ONLY public.compound_image
617 ADD CONSTRAINT compound_image_compound_id_fkey FOREIGN KEY (compound_id) REFERENCES public.compound(compound_id);
621 -- Name: compound_image compound_image_curator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
624 ALTER TABLE ONLY public.compound_image
625 ADD CONSTRAINT compound_image_curator_id_fkey FOREIGN KEY (curator_id) REFERENCES public.dbuser(dbuser_id);
629 -- Name: compound_image compound_image_image_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
632 ALTER TABLE ONLY public.compound_image
633 ADD CONSTRAINT compound_image_image_id_fkey FOREIGN KEY (image_id) REFERENCES public.image(image_id);
637 -- Name: dbxref dbxref_db_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
640 ALTER TABLE ONLY public.dbxref
641 ADD CONSTRAINT dbxref_db_id_fkey FOREIGN KEY (db_id) REFERENCES public.db(db_id);
645 -- Name: dbxref dbxref_dbuser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
648 ALTER TABLE ONLY public.dbxref
649 ADD CONSTRAINT dbxref_dbuser_id_fkey FOREIGN KEY (dbuser_id) REFERENCES public.dbuser(dbuser_id);
653 -- Name: experiment experiment_compound_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
656 ALTER TABLE ONLY public.experiment
657 ADD CONSTRAINT experiment_compound_id_fkey FOREIGN KEY (compound_id) REFERENCES public.compound(compound_id);
661 -- Name: experiment experiment_curator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
664 ALTER TABLE ONLY public.experiment
665 ADD CONSTRAINT experiment_curator_id_fkey FOREIGN KEY (curator_id) REFERENCES public.dbuser(dbuser_id);
669 -- Name: experiment experiment_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
672 ALTER TABLE ONLY public.experiment
673 ADD CONSTRAINT experiment_user_id_fkey FOREIGN KEY (dbuser_id) REFERENCES public.dbuser(dbuser_id);
677 -- Name: image image_curator_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
680 ALTER TABLE ONLY public.image
681 ADD CONSTRAINT image_curator_id_fkey FOREIGN KEY (curator_id) REFERENCES public.dbuser(dbuser_id);
685 -- Name: image image_dbuser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
688 ALTER TABLE ONLY public.image
689 ADD CONSTRAINT image_dbuser_id_fkey FOREIGN KEY (dbuser_id) REFERENCES public.dbuser(dbuser_id);
693 -- Name: result result_dbuser_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
696 ALTER TABLE ONLY public.result
697 ADD CONSTRAINT result_dbuser_id_fkey FOREIGN KEY (dbuser_id) REFERENCES public.dbuser(dbuser_id);
701 -- PostgreSQL database dump complete