Skip to content

Instantly share code, notes, and snippets.

@roy-bukapeta
Created November 16, 2017 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roy-bukapeta/006bed68b0c858af430a71c1f68e8b3f to your computer and use it in GitHub Desktop.
Save roy-bukapeta/006bed68b0c858af430a71c1f68e8b3f to your computer and use it in GitHub Desktop.
Update schema modeler grab
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.8
-- Dumped by pg_dump version 9.5.8
-- Started on 2017-11-16 15:08:46 WIB
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 281 (class 1259 OID 513324)
-- Name: grab_folder; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE grab_folder (
id integer NOT NULL,
name character varying NOT NULL,
server_id integer NOT NULL,
json json,
folder_id integer
);
--
-- TOC entry 280 (class 1259 OID 513322)
-- Name: grab_folder_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE grab_folder_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 3808 (class 0 OID 0)
-- Dependencies: 280
-- Name: grab_folder_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE grab_folder_id_seq OWNED BY grab_folder.id;
--
-- TOC entry 263 (class 1259 OID 508961)
-- Name: grab_queue; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE grab_queue (
id integer NOT NULL,
id_layer uuid,
status integer DEFAULT 0,
syntax text,
downloading_at timestamp with time zone,
downloaded_at timestamp with time zone
);
--
-- TOC entry 3809 (class 0 OID 0)
-- Dependencies: 263
-- Name: COLUMN grab_queue.status; Type: COMMENT; Schema: public; Owner: -
--
COMMENT ON COLUMN grab_queue.status IS '0 = Waiting list | 1 = Downloading | 2 = Done';
--
-- TOC entry 262 (class 1259 OID 508959)
-- Name: grab_queue_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE grab_queue_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 3810 (class 0 OID 0)
-- Dependencies: 262
-- Name: grab_queue_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE grab_queue_id_seq OWNED BY grab_queue.id;
--
-- TOC entry 267 (class 1259 OID 512949)
-- Name: grab_server; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE grab_server (
id integer NOT NULL,
name character varying NOT NULL,
description text,
url text NOT NULL,
type character varying NOT NULL,
created_at timestamp with time zone DEFAULT now(),
user_id uuid NOT NULL
);
--
-- TOC entry 266 (class 1259 OID 512947)
-- Name: grab_server_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE grab_server_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 3811 (class 0 OID 0)
-- Dependencies: 266
-- Name: grab_server_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE grab_server_id_seq OWNED BY grab_server.id;
--
-- TOC entry 283 (class 1259 OID 513335)
-- Name: grab_service; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE grab_service (
id integer NOT NULL,
server_id integer NOT NULL,
folder_id integer,
name character varying NOT NULL,
url text NOT NULL,
type character varying NOT NULL,
json json
);
--
-- TOC entry 282 (class 1259 OID 513333)
-- Name: grab_service_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE grab_service_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 3812 (class 0 OID 0)
-- Dependencies: 282
-- Name: grab_service_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE grab_service_id_seq OWNED BY grab_service.id;
--
-- TOC entry 3670 (class 2604 OID 513327)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_folder ALTER COLUMN id SET DEFAULT nextval('grab_folder_id_seq'::regclass);
--
-- TOC entry 3666 (class 2604 OID 508964)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_queue ALTER COLUMN id SET DEFAULT nextval('grab_queue_id_seq'::regclass);
--
-- TOC entry 3668 (class 2604 OID 512952)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_server ALTER COLUMN id SET DEFAULT nextval('grab_server_id_seq'::regclass);
--
-- TOC entry 3671 (class 2604 OID 513338)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_service ALTER COLUMN id SET DEFAULT nextval('grab_service_id_seq'::regclass);
--
-- TOC entry 3677 (class 2606 OID 513332)
-- Name: grab_folder_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_folder
ADD CONSTRAINT grab_folder_pkey PRIMARY KEY (id);
--
-- TOC entry 3673 (class 2606 OID 508970)
-- Name: grab_queue_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_queue
ADD CONSTRAINT grab_queue_pkey PRIMARY KEY (id);
--
-- TOC entry 3675 (class 2606 OID 512958)
-- Name: grab_server_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_server
ADD CONSTRAINT grab_server_pkey PRIMARY KEY (id);
--
-- TOC entry 3679 (class 2606 OID 513343)
-- Name: grab_service_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_service
ADD CONSTRAINT grab_service_pkey PRIMARY KEY (id);
--
-- TOC entry 3681 (class 2606 OID 513380)
-- Name: grab_folder_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_folder
ADD CONSTRAINT grab_folder_server_id_fkey FOREIGN KEY (server_id) REFERENCES grab_server(id) ON DELETE CASCADE;
--
-- TOC entry 3680 (class 2606 OID 513470)
-- Name: grab_queue_id_layer_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_queue
ADD CONSTRAINT grab_queue_id_layer_fkey FOREIGN KEY (id_layer) REFERENCES data_grab(id) ON DELETE CASCADE;
--
-- TOC entry 3682 (class 2606 OID 513385)
-- Name: grab_service_server_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY grab_service
ADD CONSTRAINT grab_service_server_id_fkey FOREIGN KEY (server_id) REFERENCES grab_server(id) ON DELETE CASCADE;
-- Completed on 2017-11-16 15:08:47 WIB
--
-- PostgreSQL database dump complete
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment