more fixes to the sql file and schema