 );
 
 CREATE UNIQUE INDEX idx_schema_table_source ON sch_chameleon.t_index_def(i_id_source,v_schema,v_table,v_index);
+
+
+CREATE TABLE sch_chameleon.t_batch_events
+(
+	i_id_batch	bigint NOT NULL,
+	I_id_event	bigint[] NOT NULL,
+	CONSTRAINT pk_t_batch_id_events PRIMARY KEY (i_id_batch)
+)
+;
+
+ALTER TABLE sch_chameleon.t_batch_events
+	ADD CONSTRAINT fk_t_batch_id_events_i_id_batch FOREIGN KEY (i_id_batch)
+	REFERENCES sch_chameleon.t_replica_batch(i_id_batch)
+	ON UPDATE RESTRICT ON DELETE CASCADE
+	;
 
 --FUNCTIONS
 CREATE OR REPLACE FUNCTION sch_chameleon.fn_refresh_parts() 

			LIMIT 1
			)
		;
		IF v_i_id_batch IS NULL 
		THEN
			RETURN v_b_loop;

		v_i_replayed		integer;
		v_i_skipped		integer;
		v_i_ddl		integer;
		v_i_evt_replay	bigint[];
		v_i_evt_queue		bigint[];
	BEGIN
		v_b_loop:=FALSE;
		v_i_replayed:=0;
