CREATE TABLE IF NOT EXISTS public.ent_nota_fiscal_replicacao ( filial_nota integer NOT NULL, filial_for integer NOT NULL, fornecedor integer NOT NULL, serie character varying(6) NOT NULL, numero integer NOT NULL, filial_destino integer NOT NULL, CONSTRAINT pk_ent_nota_fiscal_replicacao PRIMARY KEY (filial_nota, filial_for, fornecedor, serie, numero, filial_destino), CONSTRAINT fk_ent_nota_fiscal_replicacao FOREIGN KEY (filial_nota, filial_for, fornecedor, serie, numero) REFERENCES public.ent_nota_fiscal (filial_nota, filial_for, fornecedor, serie, numero) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE RESTRICT ) TABLESPACE pg_default; ALTER TABLE IF EXISTS public.ent_nota_fiscal_replicacao OWNER to postgres; COMMENT ON TABLE public.ent_nota_fiscal_replicacao IS 'Controle de Replicação de Nota Fiscal de Entrada';