Unknown column 'to_publish' in 'where clause'