CREATE TABLE IF NOT EXISTS public.log_reajuste_margem_venda ( filial_lista integer NOT NULL, lista integer NOT NULL, criacao_data date NOT NULL, criacao_hora time without time zone NOT NULL, filial_usuario integer NOT NULL, usuario integer NOT NULL, CONSTRAINT pk_log_reajuste_margem_venda PRIMARY KEY (filial_lista,lista) ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.log_reajuste_margem_venda OWNER to postgres; COMMENT ON TABLE public.log_reajuste_margem_venda IS 'Log Reajuste Margem Venda'; CREATE TABLE IF NOT EXISTS public.log_reajuste_margem_venda_item ( filial_lista integer NOT NULL, lista integer NOT NULL, filial_pro integer NOT NULL, produto integer NOT NULL, filial_tabela integer NOT NULL, tabela integer NOT NULL, ant_ind_lucr_vista numeric(18,6) NOT NULL, ant_preco_venda numeric(18,6) NOT NULL, atu_ind_lucr_vista numeric(18,6) NOT NULL, atu_preco_venda numeric(18,6) NOT NULL, CONSTRAINT pk_log_reajuste_margem_venda_item PRIMARY KEY (filial_lista, lista,filial_pro, produto), CONSTRAINT fk_log_reajuste_margem_venda_item_prod FOREIGN KEY (filial_pro, produto) REFERENCES public.pro_produto (filial_pro, codigo) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE RESTRICT ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.log_reajuste_margem_venda_item OWNER to postgres; COMMENT ON TABLE public.log_reajuste_margem_venda_item IS 'Log Reajuste Margem Venda Item';