--
-- PostgreSQL database dump
--

SET client_encoding = 'UNICODE';
SET check_function_bodies = false;

SET SESSION AUTHORIZATION 'postgres';

--
-- TOC entry 4 (OID 2200)
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
GRANT ALL ON SCHEMA public TO PUBLIC;


SET SESSION AUTHORIZATION 'lconrad';

SET search_path = public, pg_catalog;

--
-- TOC entry 8 (OID 42216)
-- Name: pga_queries; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_queries (
    queryname character varying(64),
    querytype character(1),
    querycommand text,
    querytables text,
    querylinks text,
    queryresults text,
    querycomments text
);


--
-- TOC entry 9 (OID 42216)
-- Name: pga_queries; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_queries FROM PUBLIC;
GRANT ALL ON TABLE pga_queries TO PUBLIC;


--
-- TOC entry 10 (OID 42221)
-- Name: pga_forms; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_forms (
    formname character varying(64),
    formsource text
);


--
-- TOC entry 11 (OID 42221)
-- Name: pga_forms; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_forms FROM PUBLIC;
GRANT ALL ON TABLE pga_forms TO PUBLIC;


--
-- TOC entry 12 (OID 42226)
-- Name: pga_scripts; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_scripts (
    scriptname character varying(64),
    scriptsource text
);


--
-- TOC entry 13 (OID 42226)
-- Name: pga_scripts; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_scripts FROM PUBLIC;
GRANT ALL ON TABLE pga_scripts TO PUBLIC;


--
-- TOC entry 14 (OID 42231)
-- Name: pga_reports; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_reports (
    reportname character varying(64),
    reportsource text,
    reportbody text,
    reportprocs text,
    reportoptions text
);


--
-- TOC entry 15 (OID 42231)
-- Name: pga_reports; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_reports FROM PUBLIC;
GRANT ALL ON TABLE pga_reports TO PUBLIC;


--
-- TOC entry 16 (OID 42241)
-- Name: piece; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE piece (
    id integer DEFAULT nextval('"piece_id_seq"'::text) NOT NULL,
    title character varying(100) NOT NULL,
    "composer id" integer,
    copyright boolean,
    "Directory name" character varying(80) NOT NULL,
    "pdf filename" character varying(80) DEFAULT 'allparts.pdf'::character varying NOT NULL,
    "ABC filename" character varying(80) DEFAULT 'allparts.abc'::character varying,
    "MIDI filename" character varying(80) DEFAULT 'score.mid'::character varying,
    "lilypond filename" character varying(80) DEFAULT 'allparts.zip'::character varying,
    comments text,
    "lilypond information?" boolean
);


--
-- TOC entry 17 (OID 42253)
-- Name: pga_layout; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_layout (
    tablename character varying(64),
    nrcols smallint,
    colnames text,
    colwidth text
);


--
-- TOC entry 18 (OID 42253)
-- Name: pga_layout; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_layout FROM PUBLIC;
GRANT ALL ON TABLE pga_layout TO PUBLIC;


--
-- TOC entry 5 (OID 42258)
-- Name: composer_composer id_seq; Type: SEQUENCE; Schema: public; Owner: lconrad
--

CREATE SEQUENCE "composer_composer id_seq"
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- TOC entry 19 (OID 42260)
-- Name: composer; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE composer (
    "composer id" integer DEFAULT nextval('"composer_composer id_seq"'::text) NOT NULL,
    "first name" character varying(80),
    "last name" character varying(80) NOT NULL,
    "date of birth" integer,
    "date of death" integer,
    country character varying(80),
    website character varying(120),
    comments text
);


--
-- TOC entry 6 (OID 42268)
-- Name: book_book id_seq; Type: SEQUENCE; Schema: public; Owner: lconrad
--

CREATE SEQUENCE "book_book id_seq"
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- TOC entry 20 (OID 42270)
-- Name: book; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE book (
    "book id" integer DEFAULT nextval('"book_book id_seq"'::text) NOT NULL,
    title character varying(240) NOT NULL,
    author integer NOT NULL,
    copyright boolean,
    date integer,
    directory character varying(89) NOT NULL,
    "pdf file" character varying(80),
    "MIDI file" character varying(80),
    "source file" character varying(80),
    comments text,
    html character varying
);


--
-- TOC entry 21 (OID 42280)
-- Name: piece table; Type: VIEW; Schema: public; Owner: lconrad
--

CREATE VIEW "piece table" AS
    SELECT t0.id, t0.title FROM piece t0;


--
-- TOC entry 22 (OID 42281)
-- Name: Book Pieces Table; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE "Book Pieces Table" (
    "Book ID" integer NOT NULL,
    "Piece ID" integer NOT NULL,
    "Ordinal" character varying
);


--
-- TOC entry 23 (OID 42288)
-- Name: Book IDs; Type: VIEW; Schema: public; Owner: lconrad
--

CREATE VIEW "Book IDs" AS
    SELECT t0."book id", t0.title, t0.author FROM book t0;


--
-- TOC entry 24 (OID 42289)
-- Name: piece part table; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE "piece part table" (
    "piece id" integer NOT NULL,
    "part name" character varying(20) NOT NULL,
    range character varying(10)
);


--
-- TOC entry 25 (OID 42291)
-- Name: piece relationship table; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE "piece relationship table" (
    pieceid integer NOT NULL,
    related_pieceid integer NOT NULL,
    relationship character varying(15)
);


--
-- TOC entry 7 (OID 42293)
-- Name: piece_id_sequence; Type: SEQUENCE; Schema: public; Owner: lconrad
--

CREATE SEQUENCE piece_id_sequence
    START WITH 63
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


--
-- TOC entry 26 (OID 42299)
-- Name: pga_graphs; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_graphs (
    graphname character varying(64) NOT NULL,
    graphsource text,
    graphcode text
);


--
-- TOC entry 27 (OID 42299)
-- Name: pga_graphs; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_graphs FROM PUBLIC;
GRANT ALL ON TABLE pga_graphs TO PUBLIC;


--
-- TOC entry 28 (OID 42306)
-- Name: pga_images; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_images (
    imagename character varying(64) NOT NULL,
    imagesource text
);


--
-- TOC entry 29 (OID 42306)
-- Name: pga_images; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_images FROM PUBLIC;
GRANT ALL ON TABLE pga_images TO PUBLIC;


--
-- TOC entry 30 (OID 42313)
-- Name: pga_diagrams; Type: TABLE; Schema: public; Owner: lconrad
--

CREATE TABLE pga_diagrams (
    diagramname character varying(64) NOT NULL,
    diagramtables text,
    diagramlinks text
);


--
-- TOC entry 31 (OID 42313)
-- Name: pga_diagrams; Type: ACL; Schema: public; Owner: lconrad
--

REVOKE ALL ON TABLE pga_diagrams FROM PUBLIC;
GRANT ALL ON TABLE pga_diagrams TO PUBLIC;


--
-- TOC entry 32 (OID 42251)
-- Name: piece_pkey; Type: CONSTRAINT; Schema: public; Owner: lconrad
--

ALTER TABLE ONLY piece
    ADD CONSTRAINT piece_pkey PRIMARY KEY (id);


--
-- TOC entry 33 (OID 42266)
-- Name: composer_pkey; Type: CONSTRAINT; Schema: public; Owner: lconrad
--

ALTER TABLE ONLY composer
    ADD CONSTRAINT composer_pkey PRIMARY KEY ("composer id");


--
-- TOC entry 34 (OID 42276)
-- Name: book_pkey; Type: CONSTRAINT; Schema: public; Owner: lconrad
--

ALTER TABLE ONLY book
    ADD CONSTRAINT book_pkey PRIMARY KEY ("book id");


--
-- TOC entry 35 (OID 42304)
-- Name: pga_graphs_pkey; Type: CONSTRAINT; Schema: public; Owner: lconrad
--

ALTER TABLE ONLY pga_graphs
    ADD CONSTRAINT pga_graphs_pkey PRIMARY KEY (graphname);


--
-- TOC entry 36 (OID 42311)
-- Name: pga_images_pkey; Type: CONSTRAINT; Schema: public; Owner: lconrad
--

ALTER TABLE ONLY pga_images
    ADD CONSTRAINT pga_images_pkey PRIMARY KEY (imagename);


--
-- TOC entry 37 (OID 42318)
-- Name: pga_diagrams_pkey; Type: CONSTRAINT; Schema: public; Owner: lconrad
--

ALTER TABLE ONLY pga_diagrams
    ADD CONSTRAINT pga_diagrams_pkey PRIMARY KEY (diagramname);


SET SESSION AUTHORIZATION 'postgres';

--
-- TOC entry 3 (OID 2200)
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';


