--
-- PostgreSQL database dump
--

-- Started on 2008-05-21 16:11:12

SET client_encoding = 'SQL_ASCII';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

--
-- TOC entry 1782 (class 0 OID 0)
-- Dependencies: 4
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON SCHEMA public IS 'Standard public schema';

SET search_path = public, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1346 (class 1259 OID 18378)
-- Dependencies: 4
-- Name: alocacao; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE alocacao (
    id_turma integer,
    id_sala integer,
    id integer NOT NULL
);


ALTER TABLE public.alocacao OWNER TO postgres;

--
-- TOC entry 1318 (class 1259 OID 18050)
-- Dependencies: 4
-- Name: aluno; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--


CREATE TABLE aluno
(
  id integer NOT NULL,
  nome character varying NOT NULL,
  data_nasc date,
  matricula integer NOT NULL
);

ALTER TABLE public.aluno OWNER TO postgres;

--
-- TOC entry 1332 (class 1259 OID 18260)
-- Dependencies: 4
-- Name: matricula; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE curso
(
  id integer NOT NULL,
  nome character varying NOT NULL,
  grau character varying,
  carga_horaria integer
);

ALTER TABLE public.curso OWNER TO postgres;

CREATE TABLE curso_aluno
(
  id_curso integer,
  id_aluno integer
);

ALTER TABLE public.curso_aluno OWNER TO postgres;
--
-- TOC entry 1327 (class 1259 OID 18239)
-- Dependencies: 4 1328
-- Name: curso_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.curso_id_seq OWNER TO postgres;

--
-- TOC entry 1790 (class 0 OID 0)
-- Dependencies: 1327
-- Name: curso_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE curso_id_seq OWNED BY curso.id;


--
-- TOC entry 1791 (class 0 OID 0)
-- Dependencies: 1327
-- Name: curso_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('curso_id_seq', 1, false);

CREATE TABLE matricula (
    id integer NOT NULL,
    id_aluno integer,
    id_curso integer
);


ALTER TABLE public.matricula OWNER TO postgres;

--
-- TOC entry 1331 (class 1259 OID 18258)
-- Dependencies: 1332 4
-- Name: aluno_curso_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.aluno_curso_id_seq OWNER TO postgres;

--
-- TOC entry 1784 (class 0 OID 0)
-- Dependencies: 1331
-- Name: aluno_curso_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE aluno_curso_id_seq OWNED BY matricula.id;

--
-- TOC entry 1785 (class 0 OID 0)
-- Dependencies: 1331
-- Name: aluno_curso_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('aluno_curso_id_seq', 1, false);


--
-- TOC entry 1317 (class 1259 OID 18048)
-- Dependencies: 4 1318
-- Name: aluno_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.aluno_id_seq OWNER TO postgres;

--
-- TOC entry 1786 (class 0 OID 0)
-- Dependencies: 1317
-- Name: aluno_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE aluno_id_seq OWNED BY aluno.id;


--
-- TOC entry 1787 (class 0 OID 0)
-- Dependencies: 1317
-- Name: aluno_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('aluno_id_seq', 1, false);


--
-- TOC entry 1340 (class 1259 OID 18316)
-- Dependencies: 4
-- Name: avaliacao; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE avaliacao (
    id integer NOT NULL,
    codigo character varying NOT NULL,
    data_aplicacao date,
    instrucoes character varying,
    id_funcionario integer,
    id_turma integer
);


ALTER TABLE public.avaliacao OWNER TO postgres;

--
-- TOC entry 1339 (class 1259 OID 18314)
-- Dependencies: 1340 4
-- Name: avaliacao_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.avaliacao_id_seq OWNER TO postgres;

--
-- TOC entry 1788 (class 0 OID 0)
-- Dependencies: 1339
-- Name: avaliacao_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE avaliacao_id_seq OWNED BY avaliacao.id;


--
-- TOC entry 1789 (class 0 OID 0)
-- Dependencies: 1339
-- Name: avaliacao_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('avaliacao_id_seq', 1, false);


--
-- TOC entry 1328 (class 1259 OID 18241)
-- Dependencies: 4
-- Name: curso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--


--
-- TOC entry 1326 (class 1259 OID 18227)
-- Dependencies: 4
-- Name: disciplina; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE disciplina (
    id integer NOT NULL,
    codigo character varying NOT NULL,
    nome character varying NOT NULL,
    carga_horaria integer
);


ALTER TABLE public.disciplina OWNER TO postgres;

--
-- TOC entry 1330 (class 1259 OID 18251)
-- Dependencies: 4
-- Name: ementa_curso; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE ementa_curso (
    id_disciplina integer,
    id_curso integer,
    id integer NOT NULL
);


ALTER TABLE public.ementa_curso OWNER TO postgres;

--
-- TOC entry 1329 (class 1259 OID 18249)
-- Dependencies: 1330 4
-- Name: disciplina_curso_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.disciplina_curso_id_seq OWNER TO postgres;

--
-- TOC entry 1792 (class 0 OID 0)
-- Dependencies: 1329
-- Name: disciplina_curso_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE disciplina_curso_id_seq OWNED BY ementa_curso.id;


--
-- TOC entry 1793 (class 0 OID 0)
-- Dependencies: 1329
-- Name: disciplina_curso_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('disciplina_curso_id_seq', 1, false);


--
-- TOC entry 1325 (class 1259 OID 18225)
-- Dependencies: 4 1326
-- Name: disciplina_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.disciplina_id_seq OWNER TO postgres;

--
-- TOC entry 1794 (class 0 OID 0)
-- Dependencies: 1325
-- Name: disciplina_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE disciplina_id_seq OWNED BY disciplina.id;


--
-- TOC entry 1795 (class 0 OID 0)
-- Dependencies: 1325
-- Name: disciplina_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('disciplina_id_seq', 1, false);


--
-- TOC entry 1336 (class 1259 OID 18279)
-- Dependencies: 4
-- Name: ementa; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE ementa (
    id integer NOT NULL,
    conteudo character varying NOT NULL,
    num_aulas integer NOT NULL,
    data_ementa date,
    id_disciplina integer
);


ALTER TABLE public.ementa OWNER TO postgres;

--
-- TOC entry 1335 (class 1259 OID 18277)
-- Dependencies: 4 1336
-- Name: ementa_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.ementa_id_seq OWNER TO postgres;

--
-- TOC entry 1796 (class 0 OID 0)
-- Dependencies: 1335
-- Name: ementa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE ementa_id_seq OWNED BY ementa.id;


--
-- TOC entry 1797 (class 0 OID 0)
-- Dependencies: 1335
-- Name: ementa_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('ementa_id_seq', 1, false);


--
-- TOC entry 1342 (class 1259 OID 18341)
-- Dependencies: 4
-- Name: frequencia; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE frequencia (
    id integer NOT NULL,
    presente boolean,
    id_aluno integer,
    id_turma integer
);


ALTER TABLE public.frequencia OWNER TO postgres;

--
-- TOC entry 1341 (class 1259 OID 18339)
-- Dependencies: 1342 4
-- Name: frequencia_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.frequencia_id_seq OWNER TO postgres;

--
-- TOC entry 1798 (class 0 OID 0)
-- Dependencies: 1341
-- Name: frequencia_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE frequencia_id_seq OWNED BY frequencia.id;


--
-- TOC entry 1799 (class 0 OID 0)
-- Dependencies: 1341
-- Name: frequencia_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('frequencia_id_seq', 1, false);


--
-- TOC entry 1320 (class 1259 OID 18060)
-- Dependencies: 4
-- Name: funcionario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE funcionario (
    id integer NOT NULL,
    data_admissao date,
    funcao character varying,
    matricula integer NOT NULL,
    nome character varying NOT NULL
);


ALTER TABLE public.funcionario OWNER TO postgres;

--
-- TOC entry 1319 (class 1259 OID 18058)
-- Dependencies: 4 1320
-- Name: funcionario_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.funcionario_id_seq OWNER TO postgres;

--
-- TOC entry 1800 (class 0 OID 0)
-- Dependencies: 1319
-- Name: funcionario_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE funcionario_id_seq OWNED BY funcionario.id;


--
-- TOC entry 1801 (class 0 OID 0)
-- Dependencies: 1319
-- Name: funcionario_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('funcionario_id_seq', 1, false);


--
-- TOC entry 1348 (class 1259 OID 18411)
-- Dependencies: 4
-- Name: inscricao_turma; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE inscricao_turma (
    id integer NOT NULL,
    id_aluno integer,
    id_turma integer,
    data_inscricao date
);


ALTER TABLE public.inscricao_turma OWNER TO postgres;

--
-- TOC entry 1347 (class 1259 OID 18409)
-- Dependencies: 1348 4
-- Name: inscricao_turma_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.inscricao_turma_id_seq OWNER TO postgres;

--
-- TOC entry 1802 (class 0 OID 0)
-- Dependencies: 1347
-- Name: inscricao_turma_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE inscricao_turma_id_seq OWNED BY inscricao_turma.id;


--
-- TOC entry 1803 (class 0 OID 0)
-- Dependencies: 1347
-- Name: inscricao_turma_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('inscricao_turma_id_seq', 1, false);


--
-- TOC entry 1334 (class 1259 OID 18269)
-- Dependencies: 4
-- Name: item_ementa; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE item_ementa (
    id integer NOT NULL,
    unidade integer NOT NULL,
    assunto character varying NOT NULL,
    bibliografia character varying NOT NULL,
    id_ementa integer NOT NULL
);


ALTER TABLE public.item_ementa OWNER TO postgres;

--
-- TOC entry 1333 (class 1259 OID 18267)
-- Dependencies: 4 1334
-- Name: item_ementa_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.item_ementa_id_seq OWNER TO postgres;

--
-- TOC entry 1804 (class 0 OID 0)
-- Dependencies: 1333
-- Name: item_ementa_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE item_ementa_id_seq OWNED BY item_ementa.id;


--
-- TOC entry 1805 (class 0 OID 0)
-- Dependencies: 1333
-- Name: item_ementa_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('item_ementa_id_seq', 1, false);


--
-- TOC entry 1322 (class 1259 OID 18070)
-- Dependencies: 4
-- Name: mensalidade; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE mensalidade (
    id integer NOT NULL,
    data_parcela text NOT NULL,
    data_pagto text NOT NULL,
    valor numeric(10,2) NOT NULL,
    id_aluno integer
);


ALTER TABLE public.mensalidade OWNER TO postgres;

--
-- TOC entry 1321 (class 1259 OID 18068)
-- Dependencies: 4 1322
-- Name: mensalidade_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.mensalidade_id_seq OWNER TO postgres;

--
-- TOC entry 1806 (class 0 OID 0)
-- Dependencies: 1321
-- Name: mensalidade_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE mensalidade_id_seq OWNED BY mensalidade.id;


--
-- TOC entry 1807 (class 0 OID 0)
-- Dependencies: 1321
-- Name: mensalidade_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('mensalidade_id_seq', 1, false);


--
-- TOC entry 1338 (class 1259 OID 18309)
-- Dependencies: 4
-- Name: nota; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE nota (
    id integer NOT NULL,
    valor numeric(5,2) NOT NULL,
    data_correcao date,
    data_lancamento date,
    id_aluno integer,
    id_avaliacao integer
);


ALTER TABLE public.nota OWNER TO postgres;

--
-- TOC entry 1337 (class 1259 OID 18307)
-- Dependencies: 4 1338
-- Name: nota_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.nota_id_seq OWNER TO postgres;

--
-- TOC entry 1808 (class 0 OID 0)
-- Dependencies: 1337
-- Name: nota_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE nota_id_seq OWNED BY nota.id;


--
-- TOC entry 1809 (class 0 OID 0)
-- Dependencies: 1337
-- Name: nota_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('nota_id_seq', 1, false);


--
-- TOC entry 1314 (class 1259 OID 18030)
-- Dependencies: 4
-- Name: professor; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE professor (
    id integer NOT NULL,
    nome character varying NOT NULL,
    matricula integer NOT NULL,
    titulacao character varying
);


ALTER TABLE public.professor OWNER TO postgres;

--
-- TOC entry 1313 (class 1259 OID 18028)
-- Dependencies: 4 1314
-- Name: professor_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE professor_id_seq
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.professor_id_seq OWNER TO postgres;

--
-- TOC entry 1810 (class 0 OID 0)
-- Dependencies: 1313
-- Name: professor_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE professor_id_seq OWNED BY professor.id;


--
-- TOC entry 1811 (class 0 OID 0)
-- Dependencies: 1313
-- Name: professor_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('professor_id_seq', 8, true);


--
-- TOC entry 1324 (class 1259 OID 18082)
-- Dependencies: 4
-- Name: sala; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE sala (
    id integer NOT NULL,
    numero integer,
    bloco character varying,
    campus character varying
);


ALTER TABLE public.sala OWNER TO postgres;

--
-- TOC entry 1323 (class 1259 OID 18080)
-- Dependencies: 4 1324
-- Name: sala_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.sala_id_seq OWNER TO postgres;

--
-- TOC entry 1812 (class 0 OID 0)
-- Dependencies: 1323
-- Name: sala_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE sala_id_seq OWNED BY sala.id;


--
-- TOC entry 1813 (class 0 OID 0)
-- Dependencies: 1323
-- Name: sala_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('sala_id_seq', 1, false);


--
-- TOC entry 1344 (class 1259 OID 18353)
-- Dependencies: 4
-- Name: turma; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE turma (
    id integer NOT NULL,
    codigo character varying NOT NULL,
    nome character varying NOT NULL,
    carga_horaria integer,
    id_professor integer,
    id_disciplina integer
);


ALTER TABLE public.turma OWNER TO postgres;

--
-- TOC entry 1343 (class 1259 OID 18351)
-- Dependencies: 1344 4
-- Name: turma_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.turma_id_seq OWNER TO postgres;

--
-- TOC entry 1814 (class 0 OID 0)
-- Dependencies: 1343
-- Name: turma_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE turma_id_seq OWNED BY turma.id;


--
-- TOC entry 1815 (class 0 OID 0)
-- Dependencies: 1343
-- Name: turma_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('turma_id_seq', 1, false);


--
-- TOC entry 1345 (class 1259 OID 18376)
-- Dependencies: 1346 4
-- Name: turma_sala_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.turma_sala_id_seq OWNER TO postgres;

--
-- TOC entry 1816 (class 0 OID 0)
-- Dependencies: 1345
-- Name: turma_sala_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE turma_sala_id_seq OWNED BY alocacao.id;


--
-- TOC entry 1817 (class 0 OID 0)
-- Dependencies: 1345
-- Name: turma_sala_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('turma_sala_id_seq', 1, false);


--
-- TOC entry 1316 (class 1259 OID 18040)
-- Dependencies: 4
-- Name: usuario; Type: TABLE; Schema: public; Owner: postgres; Tablespace: 
--

CREATE TABLE usuario (
    id integer NOT NULL,
    userid character varying NOT NULL,
    senha character varying,
    perfil character varying NOT NULL,
    id_pessoa integer
);


ALTER TABLE public.usuario OWNER TO postgres;

--
-- TOC entry 1818 (class 0 OID 0)
-- Dependencies: 1316
-- Name: COLUMN usuario.perfil; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.perfil IS 'prof, func, aluno, coord ou admin são os valores válidos';


--
-- TOC entry 1819 (class 0 OID 0)
-- Dependencies: 1316
-- Name: COLUMN usuario.id_pessoa; Type: COMMENT; Schema: public; Owner: postgres
--

COMMENT ON COLUMN usuario.id_pessoa IS 'id do aluno, professor ou funcionario dono do usuario';


--
-- TOC entry 1315 (class 1259 OID 18038)
-- Dependencies: 4 1316
-- Name: usuario_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

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


ALTER TABLE public.usuario_id_seq OWNER TO postgres;

--
-- TOC entry 1820 (class 0 OID 0)
-- Dependencies: 1315
-- Name: usuario_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE usuario_id_seq OWNED BY usuario.id;


--
-- TOC entry 1821 (class 0 OID 0)
-- Dependencies: 1315
-- Name: usuario_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--

SELECT pg_catalog.setval('usuario_id_seq', 1, false);


--
-- TOC entry 1695 (class 2604 OID 18380)
-- Dependencies: 1345 1346 1346
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE alocacao ALTER COLUMN id SET DEFAULT nextval('turma_sala_id_seq'::regclass);


--
-- TOC entry 1681 (class 2604 OID 18052)
-- Dependencies: 1317 1318 1318
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE aluno ALTER COLUMN id SET DEFAULT nextval('aluno_id_seq'::regclass);


--
-- TOC entry 1692 (class 2604 OID 18318)
-- Dependencies: 1339 1340 1340
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE avaliacao ALTER COLUMN id SET DEFAULT nextval('avaliacao_id_seq'::regclass);


--
-- TOC entry 1686 (class 2604 OID 18243)
-- Dependencies: 1327 1328 1328
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE curso ALTER COLUMN id SET DEFAULT nextval('curso_id_seq'::regclass);


--
-- TOC entry 1685 (class 2604 OID 18229)
-- Dependencies: 1325 1326 1326
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE disciplina ALTER COLUMN id SET DEFAULT nextval('disciplina_id_seq'::regclass);


--
-- TOC entry 1690 (class 2604 OID 18281)
-- Dependencies: 1335 1336 1336
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ementa ALTER COLUMN id SET DEFAULT nextval('ementa_id_seq'::regclass);


--
-- TOC entry 1687 (class 2604 OID 18253)
-- Dependencies: 1329 1330 1330
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ementa_curso ALTER COLUMN id SET DEFAULT nextval('disciplina_curso_id_seq'::regclass);


--
-- TOC entry 1693 (class 2604 OID 18343)
-- Dependencies: 1342 1341 1342
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE frequencia ALTER COLUMN id SET DEFAULT nextval('frequencia_id_seq'::regclass);


--
-- TOC entry 1682 (class 2604 OID 18062)
-- Dependencies: 1319 1320 1320
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE funcionario ALTER COLUMN id SET DEFAULT nextval('funcionario_id_seq'::regclass);


--
-- TOC entry 1696 (class 2604 OID 18413)
-- Dependencies: 1347 1348 1348
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE inscricao_turma ALTER COLUMN id SET DEFAULT nextval('inscricao_turma_id_seq'::regclass);


--
-- TOC entry 1689 (class 2604 OID 18271)
-- Dependencies: 1334 1333 1334
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE item_ementa ALTER COLUMN id SET DEFAULT nextval('item_ementa_id_seq'::regclass);


--
-- TOC entry 1688 (class 2604 OID 18262)
-- Dependencies: 1332 1331 1332
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE matricula ALTER COLUMN id SET DEFAULT nextval('aluno_curso_id_seq'::regclass);


--
-- TOC entry 1683 (class 2604 OID 18072)
-- Dependencies: 1322 1321 1322
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE mensalidade ALTER COLUMN id SET DEFAULT nextval('mensalidade_id_seq'::regclass);


--
-- TOC entry 1691 (class 2604 OID 18311)
-- Dependencies: 1337 1338 1338
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE nota ALTER COLUMN id SET DEFAULT nextval('nota_id_seq'::regclass);


--
-- TOC entry 1679 (class 2604 OID 18032)
-- Dependencies: 1314 1313 1314
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE professor ALTER COLUMN id SET DEFAULT nextval('professor_id_seq'::regclass);


--
-- TOC entry 1684 (class 2604 OID 18084)
-- Dependencies: 1323 1324 1324
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE sala ALTER COLUMN id SET DEFAULT nextval('sala_id_seq'::regclass);


--
-- TOC entry 1694 (class 2604 OID 18355)
-- Dependencies: 1343 1344 1344
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE turma ALTER COLUMN id SET DEFAULT nextval('turma_id_seq'::regclass);


--
-- TOC entry 1680 (class 2604 OID 18042)
-- Dependencies: 1316 1315 1316
-- Name: id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE usuario ALTER COLUMN id SET DEFAULT nextval('usuario_id_seq'::regclass);


--
-- TOC entry 1777 (class 0 OID 18378)
-- Dependencies: 1346
-- Data for Name: alocacao; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1763 (class 0 OID 18050)
-- Dependencies: 1318
-- Data for Name: aluno; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1774 (class 0 OID 18316)
-- Dependencies: 1340
-- Data for Name: avaliacao; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1768 (class 0 OID 18241)
-- Dependencies: 1328
-- Data for Name: curso; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1767 (class 0 OID 18227)
-- Dependencies: 1326
-- Data for Name: disciplina; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1772 (class 0 OID 18279)
-- Dependencies: 1336
-- Data for Name: ementa; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1769 (class 0 OID 18251)
-- Dependencies: 1330
-- Data for Name: ementa_curso; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1775 (class 0 OID 18341)
-- Dependencies: 1342
-- Data for Name: frequencia; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1764 (class 0 OID 18060)
-- Dependencies: 1320
-- Data for Name: funcionario; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1778 (class 0 OID 18411)
-- Dependencies: 1348
-- Data for Name: inscricao_turma; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1771 (class 0 OID 18269)
-- Dependencies: 1334
-- Data for Name: item_ementa; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1770 (class 0 OID 18260)
-- Dependencies: 1332
-- Data for Name: matricula; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1765 (class 0 OID 18070)
-- Dependencies: 1322
-- Data for Name: mensalidade; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1773 (class 0 OID 18309)
-- Dependencies: 1338
-- Data for Name: nota; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1761 (class 0 OID 18030)
-- Dependencies: 1314
-- Data for Name: professor; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1766 (class 0 OID 18082)
-- Dependencies: 1324
-- Data for Name: sala; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1776 (class 0 OID 18353)
-- Dependencies: 1344
-- Data for Name: turma; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1762 (class 0 OID 18040)
-- Dependencies: 1316
-- Data for Name: usuario; Type: TABLE DATA; Schema: public; Owner: postgres
--



--
-- TOC entry 1736 (class 2606 OID 18382)
-- Dependencies: 1346 1346
-- Name: alocacao_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY alocacao
    ADD CONSTRAINT alocacao_id_pk PRIMARY KEY (id);


--
-- TOC entry 1738 (class 2606 OID 18384)
-- Dependencies: 1346 1346 1346
-- Name: alocacao_id_t_id_s_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY alocacao
    ADD CONSTRAINT alocacao_id_t_id_s_uk UNIQUE (id_turma, id_sala);


--
-- TOC entry 1702 (class 2606 OID 18057)
-- Dependencies: 1318 1318
-- Name: aluno_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY aluno
    ADD CONSTRAINT aluno_id_pk PRIMARY KEY (id);


--
-- TOC entry 1730 (class 2606 OID 18323)
-- Dependencies: 1340 1340
-- Name: avaliacao_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY avaliacao
    ADD CONSTRAINT avaliacao_id_pk PRIMARY KEY (id);


--
-- TOC entry 1712 (class 2606 OID 18248)
-- Dependencies: 1328 1328
-- Name: curso_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY curso
    ADD CONSTRAINT curso_id_pk PRIMARY KEY (id);


--
-- TOC entry 1710 (class 2606 OID 18238)
-- Dependencies: 1326 1326
-- Name: disciplina_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY disciplina
    ADD CONSTRAINT disciplina_id_pk PRIMARY KEY (id);


--
-- TOC entry 1714 (class 2606 OID 18441)
-- Dependencies: 1330 1330 1330
-- Name: ementa_curso_id_c_id_d_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY ementa_curso
    ADD CONSTRAINT ementa_curso_id_c_id_d_uk UNIQUE (id_disciplina, id_curso);


--
-- TOC entry 1716 (class 2606 OID 18429)
-- Dependencies: 1330 1330
-- Name: ementa_curso_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY ementa_curso
    ADD CONSTRAINT ementa_curso_id_pk PRIMARY KEY (id);


--
-- TOC entry 1724 (class 2606 OID 18286)
-- Dependencies: 1336 1336
-- Name: ementa_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY ementa
    ADD CONSTRAINT ementa_id_pk PRIMARY KEY (id);


--
-- TOC entry 1732 (class 2606 OID 18345)
-- Dependencies: 1342 1342
-- Name: frequencia_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY frequencia
    ADD CONSTRAINT frequencia_id_pk PRIMARY KEY (id);


--
-- TOC entry 1704 (class 2606 OID 18067)
-- Dependencies: 1320 1320
-- Name: func_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY funcionario
    ADD CONSTRAINT func_id_pk PRIMARY KEY (id);


--
-- TOC entry 1740 (class 2606 OID 18427)
-- Dependencies: 1348 1348 1348
-- Name: insc_turma_id_a_id_t_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY inscricao_turma
    ADD CONSTRAINT insc_turma_id_a_id_t_uk UNIQUE (id_aluno, id_turma);


--
-- TOC entry 1742 (class 2606 OID 18415)
-- Dependencies: 1348 1348
-- Name: insc_turma_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY inscricao_turma
    ADD CONSTRAINT insc_turma_id_pk PRIMARY KEY (id);


--
-- TOC entry 1722 (class 2606 OID 18276)
-- Dependencies: 1334 1334
-- Name: item_ementa_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY item_ementa
    ADD CONSTRAINT item_ementa_id_pk PRIMARY KEY (id);


--
-- TOC entry 1718 (class 2606 OID 18408)
-- Dependencies: 1332 1332 1332
-- Name: matricula_id_c_id_a_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY matricula
    ADD CONSTRAINT matricula_id_c_id_a_uk UNIQUE (id_aluno, id_curso);


--
-- TOC entry 1720 (class 2606 OID 18396)
-- Dependencies: 1332 1332
-- Name: matricula_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY matricula
    ADD CONSTRAINT matricula_id_pk PRIMARY KEY (id);


--
-- TOC entry 1706 (class 2606 OID 18074)
-- Dependencies: 1322 1322
-- Name: mensalidade_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY mensalidade
    ADD CONSTRAINT mensalidade_id_pk PRIMARY KEY (id);


--
-- TOC entry 1726 (class 2606 OID 18443)
-- Dependencies: 1338 1338 1338
-- Name: nota_id_a_id_a_uk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY nota
    ADD CONSTRAINT nota_id_a_id_a_uk UNIQUE (id_aluno, id_avaliacao);


--
-- TOC entry 1728 (class 2606 OID 18313)
-- Dependencies: 1338 1338
-- Name: nota_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY nota
    ADD CONSTRAINT nota_id_pk PRIMARY KEY (id);


--
-- TOC entry 1698 (class 2606 OID 18037)
-- Dependencies: 1314 1314
-- Name: prof_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY professor
    ADD CONSTRAINT prof_id_pk PRIMARY KEY (id);


--
-- TOC entry 1708 (class 2606 OID 18089)
-- Dependencies: 1324 1324
-- Name: sala_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY sala
    ADD CONSTRAINT sala_id_pk PRIMARY KEY (id);


--
-- TOC entry 1734 (class 2606 OID 18360)
-- Dependencies: 1344 1344
-- Name: turma_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY turma
    ADD CONSTRAINT turma_id_pk PRIMARY KEY (id);


--
-- TOC entry 1700 (class 2606 OID 18236)
-- Dependencies: 1316 1316
-- Name: usuario_id_pk; Type: CONSTRAINT; Schema: public; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY usuario
    ADD CONSTRAINT usuario_id_pk PRIMARY KEY (id);


--
-- TOC entry 1757 (class 2606 OID 18385)
-- Dependencies: 1707 1346 1324
-- Name: alaocacao_id_sala; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY alocacao
    ADD CONSTRAINT alaocacao_id_sala FOREIGN KEY (id_sala) REFERENCES sala(id);


--
-- TOC entry 1758 (class 2606 OID 18390)
-- Dependencies: 1733 1346 1344
-- Name: alocacao_id_turma; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY alocacao
    ADD CONSTRAINT alocacao_id_turma FOREIGN KEY (id_turma) REFERENCES turma(id);


--
-- TOC entry 1752 (class 2606 OID 18324)
-- Dependencies: 1703 1320 1340
-- Name: avaliacao_id_func_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY avaliacao
    ADD CONSTRAINT avaliacao_id_func_fk FOREIGN KEY (id_funcionario) REFERENCES funcionario(id);


--
-- TOC entry 1753 (class 2606 OID 18371)
-- Dependencies: 1733 1340 1344
-- Name: avaliacao_id_turma_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY avaliacao
    ADD CONSTRAINT avaliacao_id_turma_fk FOREIGN KEY (id_turma) REFERENCES turma(id);


--
-- TOC entry 1745 (class 2606 OID 18435)
-- Dependencies: 1328 1711 1330
-- Name: ementa_curso_id_curso_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ementa_curso
    ADD CONSTRAINT ementa_curso_id_curso_fk FOREIGN KEY (id_curso) REFERENCES curso(id);


--
-- TOC entry 1744 (class 2606 OID 18430)
-- Dependencies: 1326 1709 1330
-- Name: ementa_curso_id_disciplina_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ementa_curso
    ADD CONSTRAINT ementa_curso_id_disciplina_fk FOREIGN KEY (id_disciplina) REFERENCES disciplina(id);


--
-- TOC entry 1749 (class 2606 OID 18287)
-- Dependencies: 1709 1326 1336
-- Name: ementa_id_disciplina_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY ementa
    ADD CONSTRAINT ementa_id_disciplina_fk FOREIGN KEY (id_disciplina) REFERENCES disciplina(id);


--
-- TOC entry 1754 (class 2606 OID 18346)
-- Dependencies: 1318 1342 1701
-- Name: id_aluno; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY frequencia
    ADD CONSTRAINT id_aluno FOREIGN KEY (id_aluno) REFERENCES aluno(id);


--
-- TOC entry 1759 (class 2606 OID 18416)
-- Dependencies: 1318 1348 1701
-- Name: insc_turma_id_aluno_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY inscricao_turma
    ADD CONSTRAINT insc_turma_id_aluno_fk FOREIGN KEY (id_aluno) REFERENCES aluno(id);


--
-- TOC entry 1760 (class 2606 OID 18421)
-- Dependencies: 1344 1348 1733
-- Name: insc_turma_id_turma_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY inscricao_turma
    ADD CONSTRAINT insc_turma_id_turma_fk FOREIGN KEY (id_turma) REFERENCES turma(id);


--
-- TOC entry 1748 (class 2606 OID 18292)
-- Dependencies: 1723 1334 1336
-- Name: item_ementa_id_ementa_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY item_ementa
    ADD CONSTRAINT item_ementa_id_ementa_fk FOREIGN KEY (id_ementa) REFERENCES ementa(id);


--
-- TOC entry 1747 (class 2606 OID 18402)
-- Dependencies: 1701 1318 1332
-- Name: matricula_id_aluno_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY matricula
    ADD CONSTRAINT matricula_id_aluno_fk FOREIGN KEY (id_aluno) REFERENCES aluno(id);


--
-- TOC entry 1746 (class 2606 OID 18397)
-- Dependencies: 1328 1332 1711
-- Name: matricula_id_curso_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY matricula
    ADD CONSTRAINT matricula_id_curso_fk FOREIGN KEY (id_curso) REFERENCES curso(id);


--
-- TOC entry 1743 (class 2606 OID 18075)
-- Dependencies: 1701 1318 1322
-- Name: mensalidade_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY mensalidade
    ADD CONSTRAINT mensalidade_id_fk FOREIGN KEY (id_aluno) REFERENCES aluno(id);


--
-- TOC entry 1750 (class 2606 OID 18329)
-- Dependencies: 1338 1701 1318
-- Name: nota_id_aluno_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY nota
    ADD CONSTRAINT nota_id_aluno_fk FOREIGN KEY (id_aluno) REFERENCES aluno(id);


--
-- TOC entry 1751 (class 2606 OID 18334)
-- Dependencies: 1729 1338 1340
-- Name: nota_id_avalicao_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY nota
    ADD CONSTRAINT nota_id_avalicao_fk FOREIGN KEY (id_avaliacao) REFERENCES avaliacao(id);


--
-- TOC entry 1755 (class 2606 OID 18361)
-- Dependencies: 1709 1344 1326
-- Name: turma_id_disciplina_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY turma
    ADD CONSTRAINT turma_id_disciplina_fk FOREIGN KEY (id_disciplina) REFERENCES disciplina(id);


--
-- TOC entry 1756 (class 2606 OID 18366)
-- Dependencies: 1314 1697 1344
-- Name: turma_id_professor_fk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY turma
    ADD CONSTRAINT turma_id_professor_fk FOREIGN KEY (id_professor) REFERENCES professor(id);


--
-- TOC entry 1783 (class 0 OID 0)
-- Dependencies: 4
-- 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;


-- Completed on 2008-05-21 16:11:13

--
-- PostgreSQL database dump complete
--

