Blame |
Last modification |
View Log
| Download
| RSS feed
/*========tur======================================================*/
/* DBMS name: PostgreSQL 8 */
/* Criado em: 09/12/2014 */
/* Autor: Bruno Lopes Peixoto */
/*==============================================================*/
SET search_path = sc_sec;
CREATE SEQUENCE sq_cronograma
INCREMENT 1
minvalue 1
maxvalue 99999999
START 1;
ALTER TABLE sq_cronograma owner TO sc_sec;
/*==============================================================*/
/* Table: sec_cronograma */
/*==============================================================*/
CREATE TABLE sec_cronograma (
seq_cronograma INT8 NOT NULL DEFAULT NEXTVAL('sc_sec.sq_cronograma'::regclass),
seq_vendedor INT8 NULL,
seq_loja INT8 NOT NULL,
dth_inicio TIMESTAMP NULL,
dth_fim TIMESTAMP NULL,
qtd_horas_trabalhado NUMERIC(5) NULL,
CONSTRAINT pk_cronograma PRIMARY KEY (seq_cronograma)
);
-- set table ownership
ALTER TABLE sec_cronograma owner TO sc_sec
;
/*==============================================================*/
/* Index: ix_cronograma_vendedor */
/*==============================================================*/
CREATE INDEX ix_cronograma_vendedor ON sec_cronograma (
seq_vendedor
);
/*==============================================================*/
/* Index: ix_cronograma_loja */
/*==============================================================*/
CREATE INDEX ix_cronograma_loja ON sec_cronograma (
seq_loja
);
ALTER TABLE sec_cronograma
ADD CONSTRAINT fk_cronograma_vendedor FOREIGN KEY (seq_vendedor)
REFERENCES sec_vendedor (seq_vendedor)
ON DELETE RESTRICT ON UPDATE RESTRICT;
ALTER TABLE sec_cronograma
ADD CONSTRAINT fk_cronograma_loja FOREIGN KEY (seq_loja)
REFERENCES sec_loja (seq_loja)
ON DELETE RESTRICT ON UPDATE RESTRICT;
SET search_path = public;