fixed SQL schema generation issues