text: --
  -- PostgreSQL database dump
  --
  
  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;
  
  --
  -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
  --
  
  CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
  
  
  --
  -- 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;
  
  --
  -- Name: authors; Type: TABLE; Schema: public; Owner: Guest; Tablespace: 
  --
  
  CREATE TABLE authors (
      id integer NOT NULL,
      name character varying
  );
  
  
  ALTER TABLE authors OWNER TO "Guest";
  
  --
  -- Name: author_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
  --
  
  CREATE SEQUENCE author_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  ALTER TABLE author_id_seq OWNER TO "Guest";
  
  --
  -- Name: author_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
  --
  
  ALTER SEQUENCE author_id_seq OWNED BY authors.id;
  
  
  --
  -- Name: authors_books; Type: TABLE; Schema: public; Owner: Guest; Tablespace: 
  --
  
  CREATE TABLE authors_books (
      id integer NOT NULL,
      author_id integer,
      book_id integer
  );
  
  
  ALTER TABLE authors_books OWNER TO "Guest";
  
  --
  -- Name: authors_books_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
  --
  
  CREATE SEQUENCE authors_books_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  ALTER TABLE authors_books_id_seq OWNER TO "Guest";
  
  --
  -- Name: authors_books_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
  --
  
  ALTER SEQUENCE authors_books_id_seq OWNED BY authors_books.id;
  
  
  --
  -- Name: books; Type: TABLE; Schema: public; Owner: Guest; Tablespace: 
  --
  
  CREATE TABLE books (
      id integer NOT NULL,
      title character varying,
      format character varying,
      copies integer
  );
  
  
  ALTER TABLE books OWNER TO "Guest";
  
  --
  -- Name: book_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
  --
  
  CREATE SEQUENCE book_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  ALTER TABLE book_id_seq OWNER TO "Guest";
  
  --
  -- Name: book_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
  --
  
  ALTER SEQUENCE book_id_seq OWNED BY books.id;
  
  
  --
  -- Name: log_records; Type: TABLE; Schema: public; Owner: Guest; Tablespace: 
  --
  
  CREATE TABLE log_records (
      id integer NOT NULL,
      patron_id integer,
      book_id integer,
      checkout_date date,
      is_overdue boolean
  );
  
  
  ALTER TABLE log_records OWNER TO "Guest";
  
  --
  -- Name: log_records_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
  --
  
  CREATE SEQUENCE log_records_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  ALTER TABLE log_records_id_seq OWNER TO "Guest";
  
  --
  -- Name: log_records_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
  --
  
  ALTER SEQUENCE log_records_id_seq OWNED BY log_records.id;
  
  
  --
  -- Name: patrons; Type: TABLE; Schema: public; Owner: Guest; Tablespace: 
  --
  
  CREATE TABLE patrons (
      id integer NOT NULL,
      name character varying,
      address character varying,
      phone_number character varying
  );
  
  
  ALTER TABLE patrons OWNER TO "Guest";
  
  --
  -- Name: patrons_books; Type: TABLE; Schema: public; Owner: Guest; Tablespace: 
  --
  
  CREATE TABLE patrons_books (
      id integer NOT NULL,
      patron_id integer,
      book_id integer,
      checkout_date date
  );
  
  
  ALTER TABLE patrons_books OWNER TO "Guest";
  
  --
  -- Name: patrons_books_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
  --
  
  CREATE SEQUENCE patrons_books_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  ALTER TABLE patrons_books_id_seq OWNER TO "Guest";
  
  --
  -- Name: patrons_books_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
  --
  
  ALTER SEQUENCE patrons_books_id_seq OWNED BY patrons_books.id;
  
  
  --
  -- Name: patrons_id_seq; Type: SEQUENCE; Schema: public; Owner: Guest
  --
  
  CREATE SEQUENCE patrons_id_seq
      START WITH 1
      INCREMENT BY 1
      NO MINVALUE
      NO MAXVALUE
      CACHE 1;
  
  
  ALTER TABLE patrons_id_seq OWNER TO "Guest";
  
  --
  -- Name: patrons_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: Guest
  --
  
  ALTER SEQUENCE patrons_id_seq OWNED BY patrons.id;
  
  
  --
  -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
  --
  
  ALTER TABLE ONLY authors ALTER COLUMN id SET DEFAULT nextval('author_id_seq'::regclass);
  
  
  --
  -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
  --
  
  ALTER TABLE ONLY authors_books ALTER COLUMN id SET DEFAULT nextval('authors_books_id_seq'::regclass);
  
  
  --
  -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
  --
  
  ALTER TABLE ONLY books ALTER COLUMN id SET DEFAULT nextval('book_id_seq'::regclass);
  
  
  --
  -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
  --
  
  ALTER TABLE ONLY log_records ALTER COLUMN id SET DEFAULT nextval('log_records_id_seq'::regclass);
  
  
  --
  -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
  --
  
  ALTER TABLE ONLY patrons ALTER COLUMN id SET DEFAULT nextval('patrons_id_seq'::regclass);
  
  
  --
  -- Name: id; Type: DEFAULT; Schema: public; Owner: Guest
  --
  
  ALTER TABLE ONLY patrons_books ALTER COLUMN id SET DEFAULT nextval('patrons_books_id_seq'::regclass);
  
  
  --
  -- Name: author_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
  --
  
  SELECT pg_catalog.setval('author_id_seq', 1, true);
  
  
  --
  -- Data for Name: authors; Type: TABLE DATA; Schema: public; Owner: Guest
  --
  
  COPY authors (id, name) FROM stdin;
  1	Mikhail Bulgakov
  \.
  
  
  --
  -- Data for Name: authors_books; Type: TABLE DATA; Schema: public; Owner: Guest
  --
  
  COPY authors_books (id, author_id, book_id) FROM stdin;
  1	1	1
  \.
  
  
  --
  -- Name: authors_books_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
  --
  
  SELECT pg_catalog.setval('authors_books_id_seq', 1, true);
  
  
  --
  -- Name: book_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
  --
  
  SELECT pg_catalog.setval('book_id_seq', 1, true);
  
  
  --
  -- Data for Name: books; Type: TABLE DATA; Schema: public; Owner: Guest
  --
  
  COPY books (id, title, format, copies) FROM stdin;
  1	Master and Margarita	paperback	\N
  \.
  
  
  --
  -- Data for Name: log_records; Type: TABLE DATA; Schema: public; Owner: Guest
  --
  
  COPY log_records (id, patron_id, book_id, checkout_date, is_overdue) FROM stdin;
  1	1	15	2016-01-20	f
  \.
  
  
  --
  -- Name: log_records_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
  --
  
  SELECT pg_catalog.setval('log_records_id_seq', 1, true);
  
  
  --
  -- Data for Name: patrons; Type: TABLE DATA; Schema: public; Owner: Guest
  --
  
  COPY patrons (id, name, address, phone_number) FROM stdin;
  \.
  
  
  --
  -- Data for Name: patrons_books; Type: TABLE DATA; Schema: public; Owner: Guest
  --
  
  COPY patrons_books (id, patron_id, book_id, checkout_date) FROM stdin;
  \.
  
  
  --
  -- Name: patrons_books_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
  --
  
  SELECT pg_catalog.setval('patrons_books_id_seq', 1, false);
  
  
  --
  -- Name: patrons_id_seq; Type: SEQUENCE SET; Schema: public; Owner: Guest
  --
  
  SELECT pg_catalog.setval('patrons_id_seq', 1, false);
  
  
  --
  -- Name: author_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace: 
  --
  
  ALTER TABLE ONLY authors
      ADD CONSTRAINT author_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: authors_books_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace: 
  --
  
  ALTER TABLE ONLY authors_books
      ADD CONSTRAINT authors_books_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: book_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace: 
  --
  
  ALTER TABLE ONLY books
      ADD CONSTRAINT book_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: log_records_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace: 
  --
  
  ALTER TABLE ONLY log_records
      ADD CONSTRAINT log_records_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: patrons_books_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace: 
  --
  
  ALTER TABLE ONLY patrons_books
      ADD CONSTRAINT patrons_books_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: patrons_pkey; Type: CONSTRAINT; Schema: public; Owner: Guest; Tablespace: 
  --
  
  ALTER TABLE ONLY patrons
      ADD CONSTRAINT patrons_pkey PRIMARY KEY (id);
  
  
  --
  -- Name: public; Type: ACL; Schema: -; Owner: epicodus
  --
  
  REVOKE ALL ON SCHEMA public FROM PUBLIC;
  REVOKE ALL ON SCHEMA public FROM epicodus;
  GRANT ALL ON SCHEMA public TO epicodus;
  GRANT ALL ON SCHEMA public TO PUBLIC;
  
  
  --
  -- PostgreSQL database dump complete
  --
  
  