DROP TABLE ppsnepl.epl_ndf_outgoing_differences;


CREATE TABLE ppsnepl.epl_ndf_outgoing_differences
(
   ndf_outgoing_differences_id   NUMBER (38, 0) 	NOT NULL
  ,new_value                     VARCHAR2 (256)     	NULL
  ,old_value                     VARCHAR2 (256)     	NULL
  ,vista_file_number             VARCHAR2 (20) 		NOT NULL
  ,vista_field_number            VARCHAR2 (10) 		NOT NULL
  ,vista_ien                     VARCHAR2 (50) 		NOT NULL
  ,ndc_update_file_fk            NUMBER (38, 0)
  ,action_type                   VARCHAR2 (10)  		NULL
  ,created_by                    VARCHAR2 (50) 		NOT NULL
  ,created_dtm                   TIMESTAMP (6) 		NOT NULL
);
--   TABLESPACE ppsnepl_data;

CREATE UNIQUE INDEX ppsnepl.pkndfoutgoingdifferences
   ON ppsnepl.epl_ndf_outgoing_differences (ndf_outgoing_differences_id);
--   TABLESPACE ppsnepl_data;

ALTER TABLE ppsnepl.epl_ndf_outgoing_differences ADD (
  CONSTRAINT fk_pkndfoutgoingfile
  FOREIGN KEY (ndc_update_file_fk)
  REFERENCES ppsnepl.epl_ndf_update_file (ndf_update_file_id));
  
GRANT SELECT ON ppsnepl.epl_ndf_outgoing_differences TO PPSNEPL_READ_ONLY_ROLE;