· 6 years ago · Sep 25, 2019, 08:44 AM
1-- Database generated with pgModeler (PostgreSQL Database Modeler).
2-- pgModeler version: 0.9.2-beta
3-- PostgreSQL version: 11.0
4-- Project Site: pgmodeler.io
5-- Model Author: ---
6
7-- object: conductorr | type: ROLE --
8-- DROP ROLE IF EXISTS conductorr;
9CREATE ROLE conductorr WITH
10 CREATEDB
11 LOGIN
12 ENCRYPTED PASSWORD '5AxJRGPATCqsh';
13-- ddl-end --
14
15
16-- Database creation must be done outside a multicommand file.
17-- These commands were put in this file only as a convenience.
18-- -- object: conductorrdb | type: DATABASE --
19-- -- DROP DATABASE IF EXISTS conductorrdb;
20-- CREATE DATABASE conductorrdb;
21-- -- ddl-end --
22--
23
24-- object: public.media_type | type: TYPE --
25-- DROP TYPE IF EXISTS public.media_type CASCADE;
26CREATE TYPE public.media_type AS
27 ENUM ('TV','MOVIE');
28-- ddl-end --
29ALTER TYPE public.media_type OWNER TO postgres;
30-- ddl-end --
31
32-- object: public.status | type: TYPE --
33-- DROP TYPE IF EXISTS public.status CASCADE;
34CREATE TYPE public.status AS
35 ENUM ('GRABBED','FILEBOT_RUNNING','PLEX_SCANNING','COMPLETED');
36-- ddl-end --
37ALTER TYPE public.status OWNER TO postgres;
38-- ddl-end --
39
40-- object: public."Downloads" | type: TABLE --
41-- DROP TABLE IF EXISTS public."Downloads" CASCADE;
42CREATE TABLE public."Downloads" (
43 grabber_internal_id integer NOT NULL,
44 download_id serial NOT NULL,
45 torrent_linker_id text,
46 nzb_linker_id text,
47 date_created timestamptz DEFAULT now(),
48 grabber_title text NOT NULL,
49 imdb_id text,
50 release_title text NOT NULL,
51 content_type text NOT NULL,
52 download_client text NOT NULL,
53 download_directory text,
54 status text,
55 filebot_logs text,
56 scanner_logs text,
57 grabbed_quality text,
58 grabbed_size text,
59 CONSTRAINT "Downloads_pk" PRIMARY KEY (download_id)
60
61);
62-- ddl-end --
63COMMENT ON COLUMN public."Downloads".grabber_internal_id IS 'ID corresponding to the sonarr/radarr id';
64-- ddl-end --
65COMMENT ON COLUMN public."Downloads".torrent_linker_id IS 'ID corresponding to torrent ID (hash)';
66-- ddl-end --
67COMMENT ON COLUMN public."Downloads".nzb_linker_id IS 'ID corresponding to nzbget identifier';
68-- ddl-end --
69ALTER TABLE public."Downloads" OWNER TO conductorr;
70-- ddl-end --