Changed truncate query into delete from for sqlite compatibility