Fix id column in warehouse sql