diff --git a/library/telegram/README.md b/library/telegram/README.md new file mode 100644 index 0000000..e69de29 diff --git a/postgres/sql/common.sql b/postgres/sql/common.sql new file mode 100644 index 0000000..f0bfeab --- /dev/null +++ b/postgres/sql/common.sql @@ -0,0 +1,33 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1) +-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1) + +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 xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Name: documents_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.documents_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- PostgreSQL database dump complete +-- diff --git a/postgres/sql/cross_references.sql b/postgres/sql/cross_references.sql new file mode 100644 index 0000000..d6f0b88 --- /dev/null +++ b/postgres/sql/cross_references.sql @@ -0,0 +1,43 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1) +-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1) + +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 xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: cross_references; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.cross_references ( + source_id bigint NOT NULL, + target_id bigint NOT NULL +); + + +-- +-- Name: cross_references cross_references_source_id_target_id_key; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.cross_references + ADD CONSTRAINT cross_references_source_id_target_id_key UNIQUE (source_id, target_id); + + +-- +-- PostgreSQL database dump complete +-- diff --git a/postgres/sql/scimag.sql b/postgres/sql/scimag.sql new file mode 100644 index 0000000..5492404 --- /dev/null +++ b/postgres/sql/scimag.sql @@ -0,0 +1,95 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1) +-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1) + +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 xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: scimag; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.scimag ( + id bigint DEFAULT nextval('public.documents_id_seq'::regclass) NOT NULL, + abstract text, + doi character varying(512), + filesize integer, + first_page integer, + is_deleted boolean DEFAULT false NOT NULL, + issue text, + container_title text, + journal_id integer, + language text, + last_page integer, + meta_language text, + md5 uuid, + tags text[], + telegram_file_id text, + title text, + updated_at integer DEFAULT date_part('epoch'::text, now()) NOT NULL, + volume text, + embedding bytea, + ref_by_count integer, + scimag_bulk_id integer, + issns text[], + authors text[], + issued_at bigint, + type text, + ipfs_multihashes text[] +); + + +-- +-- Name: scimag scimag_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.scimag + ADD CONSTRAINT scimag_pkey PRIMARY KEY (id); + + +-- +-- Name: scimag_doi_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX scimag_doi_idx ON public.scimag USING btree (doi); + + +-- +-- Name: scimag_md5_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX scimag_md5_idx ON public.scimag USING btree (md5); + + +-- +-- Name: scimag_telegram_file_id_not_null_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX scimag_telegram_file_id_not_null_idx ON public.scimag USING btree (telegram_file_id) WHERE (telegram_file_id IS NOT NULL); + + +-- +-- Name: scimag set_timestamp_on_scimag; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER set_timestamp_on_scimag BEFORE UPDATE ON public.scimag FOR EACH ROW EXECUTE FUNCTION public.trigger_set_updated_at(); + + +-- +-- PostgreSQL database dump complete +-- diff --git a/postgres/sql/scitech.sql b/postgres/sql/scitech.sql new file mode 100644 index 0000000..79b90c6 --- /dev/null +++ b/postgres/sql/scitech.sql @@ -0,0 +1,130 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1) +-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1) + +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 xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: scitech; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.scitech ( + id bigint DEFAULT nextval('public.documents_id_seq'::regclass) NOT NULL, + cu text, + cu_suf character varying(1), + description text, + doi character varying(512), + edition character varying(64), + extension character varying(8), + fiction_id bigint, + filesize bigint, + is_deleted boolean DEFAULT false NOT NULL, + isbns text[], + language text, + libgen_id bigint, + meta_language text, + md5 uuid NOT NULL, + pages integer, + series text, + tags text[], + telegram_file_id text, + title text, + updated_at integer DEFAULT date_part('epoch'::text, now()) NOT NULL, + original_id bigint, + volume text, + authors text[], + issued_at bigint, + ipfs_multihashes text[] +); + + +-- +-- Name: scitech scitech_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.scitech + ADD CONSTRAINT scitech_pkey PRIMARY KEY (id); + + +-- +-- Name: scitech_doi_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX scitech_doi_idx ON public.scitech USING btree (doi); + + +-- +-- Name: scitech_fiction_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX scitech_fiction_id_idx ON public.scitech USING btree (fiction_id); + + +-- +-- Name: scitech_isbn_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX scitech_isbn_idx ON public.scitech USING gin (isbns); + + +-- +-- Name: scitech_libgen_id_doi_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX scitech_libgen_id_doi_idx ON public.scitech USING btree (libgen_id, doi); + + +-- +-- Name: scitech_libgen_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX scitech_libgen_id_idx ON public.scitech USING btree (libgen_id); + + +-- +-- Name: scitech_md5_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX scitech_md5_idx ON public.scitech USING btree (md5); + + +-- +-- Name: scitech_original_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX scitech_original_id_idx ON public.scitech USING btree (original_id); + + +-- +-- Name: scitech_telegram_file_id_not_null_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX scitech_telegram_file_id_not_null_idx ON public.scitech USING btree (telegram_file_id) WHERE (telegram_file_id IS NOT NULL); + + +-- +-- Name: scitech set_timestamp_on_scitech; Type: TRIGGER; Schema: public; Owner: - +-- + +CREATE TRIGGER set_timestamp_on_scitech BEFORE UPDATE ON public.scitech FOR EACH ROW EXECUTE FUNCTION public.trigger_set_updated_at(); + + +-- +-- PostgreSQL database dump complete +-- diff --git a/postgres/sql/sharience.sql b/postgres/sql/sharience.sql new file mode 100644 index 0000000..7d78258 --- /dev/null +++ b/postgres/sql/sharience.sql @@ -0,0 +1,51 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1) +-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1) + +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 xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: sharience; Type: TABLE; Schema: public; Owner: postgres +-- + +CREATE TABLE public.sharience ( + id bigint DEFAULT nextval('public.documents_id_seq'::regclass) NOT NULL, + parent_id bigint NOT NULL, + uploader_id bigint NOT NULL, + updated_at integer DEFAULT date_part('epoch'::text, now()) NOT NULL, + md5 uuid, + filesize integer, + ipfs_multihashes text[], + telegram_file_id text +); + + +ALTER TABLE public.sharience OWNER TO postgres; + +-- +-- Name: sharience sharience_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres +-- + +ALTER TABLE ONLY public.sharience + ADD CONSTRAINT sharience_pkey PRIMARY KEY (id); + + +-- +-- PostgreSQL database dump complete +-- diff --git a/postgres/sql/votes.sql b/postgres/sql/votes.sql new file mode 100644 index 0000000..d405737 --- /dev/null +++ b/postgres/sql/votes.sql @@ -0,0 +1,43 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 13.2 (Debian 13.2-1.pgdg100+1) +-- Dumped by pg_dump version 13.2 (Debian 13.2-1.pgdg100+1) + +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 xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- Name: votes; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.votes ( + document_id bigint NOT NULL, + value integer NOT NULL, + voter_id bigint NOT NULL +); + + +-- +-- Name: votes_document_id_voter_id_idx; Type: INDEX; Schema: public; Owner: - +-- + +CREATE UNIQUE INDEX votes_document_id_voter_id_idx ON public.votes USING btree (document_id, voter_id); + + +-- +-- PostgreSQL database dump complete +--