--
-- 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;
SET row_security = off;

--
-- 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: prefs; Type: TABLE; Schema: public; Owner: agendav
--

CREATE TABLE prefs (
    username character varying(255) NOT NULL,
    options text NOT NULL
);


ALTER TABLE prefs OWNER to postgres;

--
-- Name: principals; Type: TABLE; Schema: public; Owner: agendav
--

CREATE TABLE principals (
    url character varying(255) NOT NULL,
    displayname character varying(255) NOT NULL,
    email character varying(255) NOT NULL
);


ALTER TABLE principals OWNER to postgres;

--
-- Name: schema_versions; Type: TABLE; Schema: public; Owner: agendav
--

CREATE TABLE schema_versions (
    version character varying(255) NOT NULL
);


ALTER TABLE schema_versions OWNER to postgres;

--
-- Name: sessions; Type: TABLE; Schema: public; Owner: agendav
--

CREATE TABLE sessions (
    sess_id character varying(128) NOT NULL,
    sess_data bytea NOT NULL,
    sess_lifetime integer NOT NULL,
    sess_time integer NOT NULL
);


ALTER TABLE sessions OWNER to postgres;

--
-- Name: shares; Type: TABLE; Schema: public; Owner: agendav
--

CREATE TABLE shares (
    sid integer NOT NULL,
    owner character varying(255) NOT NULL,
    calendar character varying(255) NOT NULL,
    "with" character varying(255) NOT NULL,
    options text NOT NULL,
    rw boolean NOT NULL
);


ALTER TABLE shares OWNER to postgres;

--
-- Name: shares_sid_seq; Type: SEQUENCE; Schema: public; Owner: agendav
--

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


ALTER TABLE shares_sid_seq OWNER to postgres;

--
-- Name: shares_sid_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: agendav
--

ALTER SEQUENCE shares_sid_seq OWNED BY shares.sid;


--
-- Name: sid; Type: DEFAULT; Schema: public; Owner: agendav
--

ALTER TABLE ONLY shares ALTER COLUMN sid SET DEFAULT nextval('shares_sid_seq'::regclass);


--
-- Name: prefs_pkey; Type: CONSTRAINT; Schema: public; Owner: agendav
--

ALTER TABLE ONLY prefs
    ADD CONSTRAINT prefs_pkey PRIMARY KEY (username);


--
-- Name: principals_pkey; Type: CONSTRAINT; Schema: public; Owner: agendav
--

ALTER TABLE ONLY principals
    ADD CONSTRAINT principals_pkey PRIMARY KEY (url);


--
-- Name: schema_versions_pkey; Type: CONSTRAINT; Schema: public; Owner: agendav
--

ALTER TABLE ONLY schema_versions
    ADD CONSTRAINT schema_versions_pkey PRIMARY KEY (version);


--
-- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: agendav
--

ALTER TABLE ONLY sessions
    ADD CONSTRAINT sessions_pkey PRIMARY KEY (sess_id);


--
-- Name: shares_pkey; Type: CONSTRAINT; Schema: public; Owner: agendav
--

ALTER TABLE ONLY shares
    ADD CONSTRAINT shares_pkey PRIMARY KEY (sid);


--
-- Name: idx_905f717c9890e20e; Type: INDEX; Schema: public; Owner: agendav
--

CREATE INDEX idx_905f717c9890e20e ON shares USING btree ("with");


--
-- Name: idx_905f717ccf60e67c6ea9a146; Type: INDEX; Schema: public; Owner: agendav
--

CREATE INDEX idx_905f717ccf60e67c6ea9a146 ON shares USING btree (owner, calendar);


--
-- 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;


--
-- PostgreSQL database dump complete
--

