RT#18834 Cacti integration [schema history fix and cleanup refactor]