CREATE TABLE public.ent_nota_fiscal_natureza_rendimento ( filial_nota integer NOT NULL, filial_for integer NOT NULL, fornecedor integer NOT NULL, serie character varying(6) NOT NULL, numero integer NOT NULL, natureza_rendimento integer NOT NULL, CONSTRAINT pk_ent_nota_fiscal_natureza_rendimento PRIMARY KEY (filial_nota, filial_for, fornecedor, serie, numero), CONSTRAINT fk_ent_nota_fiscal_natureza_rendimento_nota 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_natureza_rendimento OWNER to postgres; COMMENT ON TABLE public.ent_nota_fiscal_natureza_rendimento IS 'Relacionamento da Entrada de nota fiscal com a natureza do rendimento'; CREATE TABLE public.ent_aux_nota_fiscal_natureza_rendimento ( filial_nota integer NOT NULL, filial_for integer NOT NULL, fornecedor integer NOT NULL, serie character varying(6) NOT NULL, numero integer NOT NULL, natureza_rendimento integer NOT NULL, CONSTRAINT pk_ent_aux_nota_fiscal_natureza_rendimento PRIMARY KEY (filial_nota, filial_for, fornecedor, serie, numero), CONSTRAINT fk_ent_aux_nota_fiscal_natureza_rendimento_nota FOREIGN KEY (filial_nota, filial_for, fornecedor, serie, numero) REFERENCES public.ent_aux_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_aux_nota_fiscal_natureza_rendimento OWNER to postgres; COMMENT ON TABLE public.ent_aux_nota_fiscal_natureza_rendimento IS 'Relacionamento da Entrada de nota fiscal com a natureza do rendimento';