Subversion Repositories Integrator Subversion

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 espaco 1
/*========tur======================================================*/
2
/* DBMS name:      PostgreSQL 8                                 */
3
/* Criado em:     09/12/2014                                        */
4
/* Autor: Bruno Lopes Peixoto                                       */
5
/*==============================================================*/
6
 
7
SET search_path = sc_sec;
8
 
9
CREATE SEQUENCE sq_cronograma
10
INCREMENT 1
11
minvalue 1
12
maxvalue 99999999
13
START 1;
14
 
15
ALTER TABLE sq_cronograma owner TO sc_sec;
16
 
17
/*==============================================================*/
18
/* Table: sec_cronograma                                        */
19
/*==============================================================*/
20
CREATE TABLE sec_cronograma (
21
   seq_cronograma       INT8                 NOT NULL DEFAULT NEXTVAL('sc_sec.sq_cronograma'::regclass),
22
   seq_vendedor         INT8                 NULL,
23
   seq_loja             INT8                 NOT NULL,
24
   dth_inicio           TIMESTAMP            NULL,
25
   dth_fim              TIMESTAMP            NULL,
26
   qtd_horas_trabalhado NUMERIC(5)           NULL,
27
   CONSTRAINT pk_cronograma PRIMARY KEY (seq_cronograma)
28
);
29
 
30
-- set table ownership
31
ALTER TABLE sec_cronograma owner TO sc_sec
32
;
33
/*==============================================================*/
34
/* Index: ix_cronograma_vendedor                                */
35
/*==============================================================*/
36
CREATE  INDEX ix_cronograma_vendedor ON sec_cronograma (
37
seq_vendedor
38
);
39
 
40
/*==============================================================*/
41
/* Index: ix_cronograma_loja                                    */
42
/*==============================================================*/
43
CREATE  INDEX ix_cronograma_loja ON sec_cronograma (
44
seq_loja
45
);
46
 
47
ALTER TABLE sec_cronograma
48
   ADD CONSTRAINT fk_cronograma_vendedor FOREIGN KEY (seq_vendedor)
49
      REFERENCES sec_vendedor (seq_vendedor)
50
      ON DELETE RESTRICT ON UPDATE RESTRICT;
51
 
52
ALTER TABLE sec_cronograma
53
   ADD CONSTRAINT fk_cronograma_loja FOREIGN KEY (seq_loja)
54
      REFERENCES sec_loja (seq_loja)
55
      ON DELETE RESTRICT ON UPDATE RESTRICT;
56
 
57
SET search_path = public;