refactor clear_history
add db_index to program
add devicelog model