SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;

SET default_tablespace = '';

SET default_table_access_method = heap;

--
-- Name: acctval; Type: TABLE; Schema: public; Owner: joseph
--

CREATE TABLE public.acctval (
    id integer NOT NULL,
    created_at timestamp without time zone NOT NULL,
    val numeric
);


ALTER TABLE public.acctval OWNER TO joseph;

--
-- Name: acctval_id_seq; Type: SEQUENCE; Schema: public; Owner: joseph
--

CREATE SEQUENCE public.acctval_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.acctval_id_seq OWNER TO joseph;

--
-- Name: acctval_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: joseph
--

ALTER SEQUENCE public.acctval_id_seq OWNED BY public.acctval.id;


--
-- Name: pnl_daily; Type: TABLE; Schema: public; Owner: joseph
--

CREATE TABLE public.pnl_daily (
    id integer NOT NULL,
    created_at timestamp without time zone NOT NULL,
    trading_date timestamp without time zone NOT NULL,
    starting_value numeric,
    pnl numeric,
    pnl_pct numeric
);


ALTER TABLE public.pnl_daily OWNER TO joseph;

--
-- Name: pnl_daily_id_seq; Type: SEQUENCE; Schema: public; Owner: joseph
--

CREATE SEQUENCE public.pnl_daily_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.pnl_daily_id_seq OWNER TO joseph;

--
-- Name: pnl_daily_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: joseph
--

ALTER SEQUENCE public.pnl_daily_id_seq OWNED BY public.pnl_daily.id;


--
-- Name: pnl_intra; Type: TABLE; Schema: public; Owner: joseph
--

CREATE TABLE public.pnl_intra (
    id integer NOT NULL,
    created_at timestamp without time zone NOT NULL,
    pnl numeric,
    pnl_unrealized numeric,
    pnl_realized numeric
);


ALTER TABLE public.pnl_intra OWNER TO joseph;

--
-- Name: pnl_intra_id_seq; Type: SEQUENCE; Schema: public; Owner: joseph
--

CREATE SEQUENCE public.pnl_intra_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;


ALTER SEQUENCE public.pnl_intra_id_seq OWNER TO joseph;

--
-- Name: pnl_intra_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: joseph
--

ALTER SEQUENCE public.pnl_intra_id_seq OWNED BY public.pnl_intra.id;


--
-- Name: acctval id; Type: DEFAULT; Schema: public; Owner: joseph
--

ALTER TABLE ONLY public.acctval ALTER COLUMN id SET DEFAULT nextval('public.acctval_id_seq'::regclass);


--
-- Name: pnl_daily id; Type: DEFAULT; Schema: public; Owner: joseph
--

ALTER TABLE ONLY public.pnl_daily ALTER COLUMN id SET DEFAULT nextval('public.pnl_daily_id_seq'::regclass);


--
-- Name: pnl_intra id; Type: DEFAULT; Schema: public; Owner: joseph
--

ALTER TABLE ONLY public.pnl_intra ALTER COLUMN id SET DEFAULT nextval('public.pnl_intra_id_seq'::regclass);


--
-- Name: acctval acctval_pkey; Type: CONSTRAINT; Schema: public; Owner: joseph
--

ALTER TABLE ONLY public.acctval
    ADD CONSTRAINT acctval_pkey PRIMARY KEY (id);


--
-- Name: pnl_daily pnl_daily_pkey; Type: CONSTRAINT; Schema: public; Owner: joseph
--

ALTER TABLE ONLY public.pnl_daily
    ADD CONSTRAINT pnl_daily_pkey PRIMARY KEY (id);


--
-- Name: pnl_intra pnl_intra_pkey; Type: CONSTRAINT; Schema: public; Owner: joseph
--

ALTER TABLE ONLY public.pnl_intra
    ADD CONSTRAINT pnl_intra_pkey PRIMARY KEY (id);


--
-- Name: idx_acctval_created_at; Type: INDEX; Schema: public; Owner: joseph
--

CREATE INDEX idx_acctval_created_at ON public.acctval USING btree (created_at);


--
-- Name: idx_pnl_daily_created_at; Type: INDEX; Schema: public; Owner: joseph
--

CREATE INDEX idx_pnl_daily_created_at ON public.pnl_daily USING btree (created_at);


--
-- Name: idx_pnl_daily_trading_date; Type: INDEX; Schema: public; Owner: joseph
--

CREATE INDEX idx_pnl_daily_trading_date ON public.pnl_daily USING btree (trading_date);


--
-- Name: idx_pnl_intra_created_at; Type: INDEX; Schema: public; Owner: joseph
--

CREATE INDEX idx_pnl_intra_created_at ON public.pnl_intra USING btree (created_at);