1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-25 00:53:43 +00:00

Update db schema with tags column, which I had forgotten :(

This commit is contained in:
King_DuckZ 2016-05-18 00:51:23 +02:00
parent 6b5fe85571
commit bc1ff586c0

View file

@ -2,9 +2,10 @@
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.5
-- Dumped by pg_dump version 9.4.5
-- Started on 2016-02-22 08:40:56 CET
-- Dumped from database version 9.5.2
-- Dumped by pg_dump version 9.5.2
-- Started on 2016-05-18 00:47:01 CEST
SET statement_timeout = 0;
SET lock_timeout = 0;
@ -12,9 +13,10 @@ SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 176 (class 3079 OID 11873)
-- TOC entry 1 (class 3079 OID 12373)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
@ -22,8 +24,8 @@ CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 2045 (class 0 OID 0)
-- Dependencies: 176
-- TOC entry 2152 (class 0 OID 0)
-- Dependencies: 1
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
@ -33,7 +35,7 @@ COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
--
-- TOC entry 191 (class 1255 OID 16437)
-- TOC entry 185 (class 1255 OID 16386)
-- Name: str_begins_with(text, text); Type: FUNCTION; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -47,7 +49,7 @@ $_$;
ALTER FUNCTION public.str_begins_with(text, text) OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 189 (class 1255 OID 16386)
-- TOC entry 186 (class 1255 OID 16387)
-- Name: str_match_partial(text, text, boolean); Type: FUNCTION; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -64,7 +66,7 @@ $_$;
ALTER FUNCTION public.str_match_partial(text, text, boolean) OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 190 (class 1255 OID 16387)
-- TOC entry 187 (class 1255 OID 16388)
-- Name: upcase_hash(); Type: FUNCTION; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -85,8 +87,8 @@ SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 172 (class 1259 OID 16388)
-- Name: files; Type: TABLE; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 181 (class 1259 OID 16389)
-- Name: files; Type: TABLE; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE TABLE files (
@ -104,6 +106,7 @@ CREATE TABLE files (
unreadable boolean NOT NULL,
mimetype character varying NOT NULL,
charset character varying NOT NULL,
tags text[] DEFAULT '{}'::text[] NOT NULL,
CONSTRAINT chk_files_dirsize_zero CHECK (((is_directory = false) OR (size = 0))),
CONSTRAINT chk_hash_0 CHECK ((((NOT unreadable) AND is_hash_valid) OR ((NOT is_hash_valid) AND (hash ~ '^0+$'::text))))
);
@ -112,8 +115,8 @@ CREATE TABLE files (
ALTER TABLE files OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2046 (class 0 OID 0)
-- Dependencies: 172
-- TOC entry 2153 (class 0 OID 0)
-- Dependencies: 181
-- Name: CONSTRAINT chk_hash_0 ON files; Type: COMMENT; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -121,7 +124,7 @@ COMMENT ON CONSTRAINT chk_hash_0 ON files IS 'Make sure hash is 0 if unreadable
--
-- TOC entry 173 (class 1259 OID 16397)
-- TOC entry 182 (class 1259 OID 16398)
-- Name: files_id_seq; Type: SEQUENCE; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -136,8 +139,8 @@ CREATE SEQUENCE files_id_seq
ALTER TABLE files_id_seq OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2047 (class 0 OID 0)
-- Dependencies: 173
-- TOC entry 2154 (class 0 OID 0)
-- Dependencies: 182
-- Name: files_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -145,8 +148,8 @@ ALTER SEQUENCE files_id_seq OWNED BY files.id;
--
-- TOC entry 174 (class 1259 OID 16399)
-- Name: sets; Type: TABLE; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 183 (class 1259 OID 16400)
-- Name: sets; Type: TABLE; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE TABLE sets (
@ -157,15 +160,15 @@ CREATE TABLE sets (
creation timestamp with time zone DEFAULT now() NOT NULL,
app_name character varying NOT NULL,
content_type character(1) DEFAULT 'G'::bpchar NOT NULL,
CONSTRAINT chk_sets_type CHECK (((((((((type = 'C'::bpchar) OR (type = 'D'::bpchar)) OR (type = 'V'::bpchar)) OR (type = 'B'::bpchar)) OR (type = 'F'::bpchar)) OR (type = 'H'::bpchar)) OR (type = 'Z'::bpchar)) OR (type = 'O'::bpchar)))
CONSTRAINT chk_sets_type CHECK (((type = 'C'::bpchar) OR (type = 'D'::bpchar) OR (type = 'V'::bpchar) OR (type = 'B'::bpchar) OR (type = 'F'::bpchar) OR (type = 'H'::bpchar) OR (type = 'Z'::bpchar) OR (type = 'O'::bpchar)))
);
ALTER TABLE sets OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2048 (class 0 OID 0)
-- Dependencies: 174
-- TOC entry 2155 (class 0 OID 0)
-- Dependencies: 183
-- Name: COLUMN sets.type; Type: COMMENT; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -179,7 +182,7 @@ O = Other';
--
-- TOC entry 175 (class 1259 OID 16409)
-- TOC entry 184 (class 1259 OID 16411)
-- Name: sets_id_seq; Type: SEQUENCE; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -194,8 +197,8 @@ CREATE SEQUENCE sets_id_seq
ALTER TABLE sets_id_seq OWNER TO @DB_OWNER_NAME@;
--
-- TOC entry 2049 (class 0 OID 0)
-- Dependencies: 175
-- TOC entry 2156 (class 0 OID 0)
-- Dependencies: 184
-- Name: sets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -203,7 +206,7 @@ ALTER SEQUENCE sets_id_seq OWNED BY sets.id;
--
-- TOC entry 1909 (class 2604 OID 16411)
-- TOC entry 2009 (class 2604 OID 16413)
-- Name: id; Type: DEFAULT; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -211,7 +214,7 @@ ALTER TABLE ONLY files ALTER COLUMN id SET DEFAULT nextval('files_id_seq'::regcl
--
-- TOC entry 1915 (class 2604 OID 16412)
-- TOC entry 2017 (class 2604 OID 16414)
-- Name: id; Type: DEFAULT; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -219,8 +222,8 @@ ALTER TABLE ONLY sets ALTER COLUMN id SET DEFAULT nextval('sets_id_seq'::regclas
--
-- TOC entry 1922 (class 2606 OID 16414)
-- Name: pk_files_id; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 2024 (class 2606 OID 16416)
-- Name: pk_files_id; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER TABLE ONLY files
@ -228,8 +231,8 @@ ALTER TABLE ONLY files
--
-- TOC entry 1926 (class 2606 OID 16416)
-- Name: pk_sets_id; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 2028 (class 2606 OID 16418)
-- Name: pk_sets_id; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER TABLE ONLY sets
@ -237,8 +240,8 @@ ALTER TABLE ONLY sets
--
-- TOC entry 1924 (class 2606 OID 16418)
-- Name: uniq_item; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 2026 (class 2606 OID 16420)
-- Name: uniq_item; Type: CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@
--
ALTER TABLE ONLY files
@ -246,31 +249,39 @@ ALTER TABLE ONLY files
--
-- TOC entry 1918 (class 1259 OID 16419)
-- Name: fki_files_sets; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 2019 (class 1259 OID 16421)
-- Name: fki_files_sets; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE INDEX fki_files_sets ON files USING btree (group_id);
--
-- TOC entry 1919 (class 1259 OID 16420)
-- Name: idx_mimetype; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 2020 (class 1259 OID 16422)
-- Name: idx_mimetype; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE INDEX idx_mimetype ON files USING btree (mimetype, charset);
--
-- TOC entry 1920 (class 1259 OID 16421)
-- Name: idx_paths; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@; Tablespace:
-- TOC entry 2021 (class 1259 OID 16423)
-- Name: idx_paths; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE INDEX idx_paths ON files USING btree (path);
--
-- TOC entry 1928 (class 2620 OID 16422)
-- TOC entry 2022 (class 1259 OID 16475)
-- Name: idx_tags; Type: INDEX; Schema: public; Owner: @DB_OWNER_NAME@
--
CREATE INDEX idx_tags ON files USING gin (tags);
--
-- TOC entry 2030 (class 2620 OID 16424)
-- Name: triggerupcasehash; Type: TRIGGER; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -278,7 +289,7 @@ CREATE TRIGGER triggerupcasehash BEFORE INSERT OR UPDATE ON files FOR EACH ROW E
--
-- TOC entry 1927 (class 2606 OID 16423)
-- TOC entry 2029 (class 2606 OID 16425)
-- Name: fk_files_sets; Type: FK CONSTRAINT; Schema: public; Owner: @DB_OWNER_NAME@
--
@ -287,8 +298,8 @@ ALTER TABLE ONLY files
--
-- TOC entry 2044 (class 0 OID 0)
-- Dependencies: 6
-- TOC entry 2151 (class 0 OID 0)
-- Dependencies: 7
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
@ -298,7 +309,7 @@ GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
-- Completed on 2016-02-22 08:40:57 CET
-- Completed on 2016-05-18 00:47:01 CEST
--
-- PostgreSQL database dump complete