restore sql queries from previous commit