updated schema, added tests, fixed sql.go