Skip to content

Instantly share code, notes, and snippets.

@Bigcheese
Created March 22, 2015 08:44
Show Gist options
  • Save Bigcheese/3c64b800c78bda6ff08c to your computer and use it in GitHub Desktop.
Save Bigcheese/3c64b800c78bda6ff08c to your computer and use it in GitHub Desktop.
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.1
-- Dumped by pg_dump version 9.4.1
-- Started on 2015-03-22 01:43:06
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- TOC entry 178 (class 3079 OID 11855)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 2025 (class 0 OID 0)
-- Dependencies: 178
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- TOC entry 174 (class 1259 OID 16415)
-- Name: prices; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE prices (
id integer NOT NULL,
price numeric(8,2),
guid integer,
currency character(3),
url integer,
datetime timestamp without time zone,
store integer
);
ALTER TABLE prices OWNER TO postgres;
--
-- TOC entry 175 (class 1259 OID 16418)
-- Name: prices_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE prices_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE prices_id_seq OWNER TO postgres;
--
-- TOC entry 2026 (class 0 OID 0)
-- Dependencies: 175
-- Name: prices_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE prices_id_seq OWNED BY prices.id;
--
-- TOC entry 177 (class 1259 OID 16435)
-- Name: stores; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE stores (
id integer NOT NULL,
name character varying
);
ALTER TABLE stores OWNER TO postgres;
--
-- TOC entry 176 (class 1259 OID 16433)
-- Name: stores_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE stores_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE stores_id_seq OWNER TO postgres;
--
-- TOC entry 2027 (class 0 OID 0)
-- Dependencies: 176
-- Name: stores_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE stores_id_seq OWNED BY stores.id;
--
-- TOC entry 172 (class 1259 OID 16395)
-- Name: url; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE url (
id integer NOT NULL,
url character varying
);
ALTER TABLE url OWNER TO postgres;
--
-- TOC entry 173 (class 1259 OID 16403)
-- Name: url_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE url_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE url_id_seq OWNER TO postgres;
--
-- TOC entry 2028 (class 0 OID 0)
-- Dependencies: 173
-- Name: url_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE url_id_seq OWNED BY url.id;
--
-- TOC entry 1896 (class 2604 OID 16420)
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY prices ALTER COLUMN id SET DEFAULT nextval('prices_id_seq'::regclass);
--
-- TOC entry 1897 (class 2604 OID 16438)
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY stores ALTER COLUMN id SET DEFAULT nextval('stores_id_seq'::regclass);
--
-- TOC entry 1895 (class 2604 OID 16405)
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY url ALTER COLUMN id SET DEFAULT nextval('url_id_seq'::regclass);
--
-- TOC entry 1903 (class 2606 OID 16422)
-- Name: prices_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY prices
ADD CONSTRAINT prices_pkey PRIMARY KEY (id);
--
-- TOC entry 1906 (class 2606 OID 16443)
-- Name: stores_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY stores
ADD CONSTRAINT stores_pkey PRIMARY KEY (id);
--
-- TOC entry 1899 (class 2606 OID 16407)
-- Name: url_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace:
--
ALTER TABLE ONLY url
ADD CONSTRAINT url_pkey PRIMARY KEY (id);
--
-- TOC entry 1901 (class 1259 OID 16450)
-- Name: fki_prices_stores_fkey -> store; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX "fki_prices_stores_fkey -> store" ON prices USING btree (store);
--
-- TOC entry 1904 (class 1259 OID 16444)
-- Name: stores_name_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX stores_name_idx ON stores USING btree (name);
--
-- TOC entry 1900 (class 1259 OID 16432)
-- Name: url_url_idx; Type: INDEX; Schema: public; Owner: postgres; Tablespace:
--
CREATE INDEX url_url_idx ON url USING btree (url);
--
-- TOC entry 1908 (class 2606 OID 16445)
-- Name: prices_stores_fkey -> store; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY prices
ADD CONSTRAINT "prices_stores_fkey -> store" FOREIGN KEY (store) REFERENCES stores(id);
--
-- TOC entry 1907 (class 2606 OID 16427)
-- Name: prices_url_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY prices
ADD CONSTRAINT prices_url_fkey FOREIGN KEY (url) REFERENCES url(id);
--
-- TOC entry 2024 (class 0 OID 0)
-- Dependencies: 5
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--
REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;
-- Completed on 2015-03-22 01:43:07
--
-- PostgreSQL database dump complete
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment