CREATE TABLE request_to_document_map ( id serial NOT NULL, request_id integer, mapping_document_type_id integer, document_number integer, document_id integer, business_entity_id integer, CONSTRAINT request_to_document_map_pk PRIMARY KEY (id), CONSTRAINT request_to_document_map_fk1 FOREIGN KEY (request_id) REFERENCES request (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT request_to_document_map_fk2 FOREIGN KEY (mapping_document_type_id) REFERENCES mapping_document_type (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT request_to_document_map_fk4 FOREIGN KEY (business_entity_id) REFERENCES business_entity (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH ( OIDS=FALSE ); ALTER TABLE request_to_document_map OWNER TO postgres;