Fixed sql schema generation