CREATE TABLE public.dis_pedidos_distribuicao_cpl ( filial_orc integer NOT NULL, orcamento integer NOT NULL, sequencia integer NOT NULL, almox_vnd integer NOT NULL, espessura numeric(18,6) NOT NULL, largura numeric(18,6) NOT NULL, comprimento numeric(18,6) NOT NULL, quantidade_pedido_cli numeric(18,6) NOT NULL, preco_unit_pedido_cli numeric(18,6) NOT NULL, valor_total_pedido_cli numeric(18,6) NOT NULL, tipo_embalagem integer NOT NULL, lote_vnd integer NOT NULL, tipo_embalagem_operacao integer NOT NULL, qtd_embalagem integer NOT NULL, CONSTRAINT pk_dis_pedidos_distribuicao_cpl PRIMARY KEY (filial_orc, orcamento, sequencia), CONSTRAINT fk_dis_pedidos_distribuicao_cpl FOREIGN KEY (filial_orc, orcamento, sequencia) REFERENCES public.dis_pedidos_distribuicao (filial_orc, orcamento, sequencia) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE RESTRICT ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.dis_pedidos_distribuicao_cpl OWNER to postgres; COMMENT ON TABLE public.dis_pedidos_distribuicao_cpl IS 'Distribuição Pedidos - Observação dos Itens do Pedido'; CREATE TABLE public.dis_pedidos_distribuicao_servico ( filial_orc integer NOT NULL, sequencia integer NOT NULL, orcamento integer NOT NULL, sequencia_it integer NOT NULL, filial_tipo_servico integer NOT NULL, tipo_servico integer NOT NULL, fator numeric(18,6) NOT NULL, valor_unit numeric(18,6) NOT NULL, valor_total numeric(18,6) NOT NULL, instalador integer NOT NULL, hora_inicial time without time zone NOT NULL, hora_final time without time zone NOT NULL, CONSTRAINT pk_dis_pedidos_distribuicao_servico PRIMARY KEY (filial_orc, sequencia, orcamento, sequencia_it, filial_tipo_servico, tipo_servico), CONSTRAINT fk_dis_pedidos_distribuicao_servico FOREIGN KEY (filial_orc, orcamento, sequencia_it) REFERENCES public.dis_pedidos_distribuicao (filial_orc, orcamento, sequencia) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE RESTRICT ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.dis_pedidos_distribuicao_servico OWNER to postgres; COMMENT ON TABLE public.dis_pedidos_distribuicao_servico IS 'Distribuição Pedidos - Serviços dos Itens do Pedido';