Updated SQL structure and version