 
 	WHILE i < size LOOP
 		insert into {databaseSchema}.mt_rolling_buffer 
-			(slot, message_id, timestamp, events, stream_id, reference_count)
+			(slot, message_id, timestamp, event_id, stream_id, reference_count)
 		values
-			(i + 1, 0, timestamp, ARRAY[0], empty, 0);
+			(i + 1, 0, timestamp, empty, empty, 0);
 
 		i := i + 1;
 	END LOOP;

END
$$ LANGUAGE plpgsql;





$$ LANGUAGE plpgsql;


CREATE OR REPLACE FUNCTION {databaseSchema}.mt_append_rolling_buffer(event UUID, stream UUID) RETURNS integer AS $$
DECLARE
	id int := nextval('{databaseSchema}.mt_rolling_buffer_sequence');
	next int;
