Coverted the posts to sql