--
--

-- Started on 2008-02-18 15:46:02 BRT




CREATE SCHEMA ligacoes_telefonicas;


ALTER SCHEMA ligacoes_telefonicas OWNER TO admin_ltelefonicas;




--
-- TOC entry 1659 (class 1259 OID 1417995)
-- Dependencies: 2249 8
-- Name: ligacao_telefonica; Type: TABLE; Schema: ligacoes_telefonicas; Owner: admin_ltelefonicas; Tablespace: 
--

CREATE TABLE ligacao_telefonica (
    usuario integer NOT NULL,
    data_hora timestamp without time zone NOT NULL,
    motivo smallint,
    tipo_ligacao smallint,
    telefone character varying(20),
    valor numeric(7,2),
    avaliador integer,
    telefonista integer,
    setor_id integer,
    status smallint,
    observacoes text,
    cidade bigint,
    mes_referencia date,
    historico boolean DEFAULT false,
    numero_folhas smallint
);


ALTER TABLE ligacoes_telefonicas.ligacao_telefonica OWNER TO admin_ltelefonicas;

--
-- TOC entry 2251 (class 2606 OID 1463091)
-- Dependencies: 1659 1659 1659
-- Name: ligacao_telefonica_pkey; Type: CONSTRAINT; Schema: ligacoes_telefonicas; Owner: admin_ltelefonicas; Tablespace: 
--

ALTER TABLE ONLY ligacao_telefonica
    ADD CONSTRAINT ligacao_telefonica_pkey PRIMARY KEY (usuario, data_hora);


--
-- TOC entry 2253 (class 0 OID 0)
-- Dependencies: 8
-- Name: ligacoes_telefonicas; Type: ACL; Schema: -; Owner: admin_ltelefonicas
--

REVOKE ALL ON SCHEMA ligacoes_telefonicas FROM PUBLIC;
REVOKE ALL ON SCHEMA ligacoes_telefonicas FROM admin_ltelefonicas;
GRANT ALL ON SCHEMA ligacoes_telefonicas TO admin_ltelefonicas;
GRANT ALL ON SCHEMA ligacoes_telefonicas TO postgres;
GRANT ALL ON SCHEMA ligacoes_telefonicas TO admin_workflow;


--
-- TOC entry 2254 (class 0 OID 0)
-- Dependencies: 1659
-- Name: ligacao_telefonica; Type: ACL; Schema: ligacoes_telefonicas; Owner: admin_ltelefonicas
--

REVOKE ALL ON TABLE ligacao_telefonica FROM PUBLIC;
REVOKE ALL ON TABLE ligacao_telefonica FROM admin_ltelefonicas;
GRANT ALL ON TABLE ligacao_telefonica TO admin_ltelefonicas;
GRANT ALL ON TABLE ligacao_telefonica TO postgres;
GRANT ALL ON TABLE ligacao_telefonica TO admin_workflow;


-- Completed on 2008-02-18 15:46:03 BRT

--
--

