From 2959eb5cfda1298be75a254567707b1caf7dc8b0 Mon Sep 17 00:00:00 2001 From: Michel ten Voorde Date: Sat, 12 Oct 2024 13:37:59 +0200 Subject: [PATCH] Move to new server --- Dockerfile | 5 + Jenkinsfile | 63 + TODO | 7 + docker-build.sh | 1 + docker-run.sh | 1 + k8s/deployment.yaml | 38 + k8s/external-postgres-service.yaml | 27 + k8s/renovate-cronjob.yaml | 26 + k8s/renovate-secret.yaml | 13 + k8s/service.yaml | 12 + keys/keypair.pem | 28 + pom.xml | 185 + renovate.json | 11 + .../connectedit/swiss/SwissApplication.java | 15 + .../AuthenticationController.java | 46 + .../authentication/AuthenticationRequest.java | 20 + .../AuthenticationResponse.java | 14 + .../swiss/authentication/Client.java | 13 + .../authentication/ClientRepository.java | 23 + .../authentication/JwtRequestFilter.java | 57 + .../authentication/JwtSecurityConfig.java | 62 + .../swiss/authentication/JwtTokenService.java | 51 + .../swiss/authentication/JwtUserDetails.java | 19 + .../authentication/JwtUserDetailsService.java | 27 + .../authentication/LoginCredentialsDto.java | 13 + .../swiss/authentication/UserDto.java | 16 + .../swiss/authentication/UserRoles.java | 8 + .../connectedit/swiss/config/CorsConfig.java | 25 + .../connectedit/swiss/config/JsonConfig.java | 14 + .../swiss/config/SecurityConfig.java | 26 + .../swiss/controller/PlayerController.java | 53 + .../controller/RegistrationController.java | 53 + .../RestResponseEntityExceptionHandler.java | 21 + .../swiss/controller/TestController.java | 507 +++ .../controller/TournamentController.java | 184 + .../swiss/domain/EventDivision.java | 15 + .../connectedit/swiss/domain/EventType.java | 20 + .../swiss/domain/EventValidation.java | 16 + .../swiss/domain/PlayerStrength.java | 17 + .../java/nl/connectedit/swiss/domain/Sex.java | 10 + .../nl/connectedit/swiss/domain/Status.java | 8 + .../swiss/domain/TournamentDivision.java | 17 + .../swiss/domain/TournamentStatus.java | 17 + .../swiss/domain/TournamentValidation.java | 20 + .../connectedit/swiss/domain/Validation.java | 19 + .../swiss/domain/entity/AbstractEntity.java | 27 + .../swiss/domain/entity/Event.java | 62 + .../connectedit/swiss/domain/entity/Game.java | 26 + .../swiss/domain/entity/Group.java | 38 + .../swiss/domain/entity/Match.java | 49 + .../swiss/domain/entity/Player.java | 77 + .../swiss/domain/entity/Registration.java | 35 + .../swiss/domain/entity/Round.java | 39 + .../connectedit/swiss/domain/entity/Team.java | 34 + .../swiss/domain/entity/Tournament.java | 71 + .../swiss/domain/entity/TournamentPlayer.java | 31 + .../nl/connectedit/swiss/dto/AbstractDto.java | 4 + .../nl/connectedit/swiss/dto/EventDto.java | 22 + .../swiss/dto/EventRegistrationDto.java | 20 + .../swiss/dto/EventValidationDto.java | 13 + .../nl/connectedit/swiss/dto/GameDto.java | 13 + .../nl/connectedit/swiss/dto/GroupDto.java | 26 + .../nl/connectedit/swiss/dto/MatchDto.java | 32 + .../nl/connectedit/swiss/dto/PlayerDto.java | 34 + .../swiss/dto/RegistrationDto.java | 15 + .../nl/connectedit/swiss/dto/ResultDto.java | 15 + .../nl/connectedit/swiss/dto/RoundDto.java | 26 + .../connectedit/swiss/dto/StandingsDto.java | 13 + .../connectedit/swiss/dto/StandingsEntry.java | 69 + .../swiss/dto/StandingsEntryDto.java | 30 + .../nl/connectedit/swiss/dto/TeamDto.java | 13 + .../connectedit/swiss/dto/TournamentDto.java | 32 + .../swiss/dto/TournamentPlayerDto.java | 23 + .../swiss/dto/TournamentRegistrationDto.java | 25 + .../swiss/dto/TournamentValidationDto.java | 19 + .../connectedit/swiss/dto/ValidationDto.java | 11 + .../connectedit/swiss/mapper/DtoMapper.java | 8 + .../swiss/mapper/EntityMapper.java | 8 + .../connectedit/swiss/mapper/EventMapper.java | 66 + .../connectedit/swiss/mapper/GameMapper.java | 18 + .../connectedit/swiss/mapper/GroupMapper.java | 55 + .../connectedit/swiss/mapper/MatchMapper.java | 39 + .../swiss/mapper/PlayerMapper.java | 57 + .../swiss/mapper/RegistrationMapper.java | 36 + .../connectedit/swiss/mapper/RoundMapper.java | 53 + .../swiss/mapper/StandingsMapper.java | 42 + .../connectedit/swiss/mapper/TeamMapper.java | 25 + .../swiss/mapper/TournamentMapper.java | 81 + .../swiss/mapper/TournamentPlayerMapper.java | 29 + .../TournamentPlayerRegistrationMapper.java | 78 + .../mapper/TournamentValidationMapper.java | 45 + .../swiss/repository/PlayerRepository.java | 8 + .../repository/RegistrationRepository.java | 17 + .../repository/TournamentRepository.java | 12 + .../swiss/service/PlayerService.java | 29 + .../swiss/service/RegistrationService.java | 53 + .../swiss/service/ServiceUtil.java | 51 + .../swiss/service/StandingsService.java | 116 + .../service/TournamentDivideService.java | 157 + .../swiss/service/TournamentDrawService.java | 183 + .../swiss/service/TournamentPlayService.java | 279 ++ .../swiss/service/TournamentService.java | 43 + .../service/TournamentValidationService.java | 223 + .../resources/application-local-postgres.yaml | 27 + src/main/resources/application-local.yaml | 39 + src/main/resources/application.yaml | 33 + src/main/resources/certs/private.pem | 28 + src/main/resources/certs/public.pem | 9 + src/main/resources/db/migration/V1__init.sql | 303 ++ src/main/resources/export.sql | 3903 +++++++++++++++++ src/main/resources/export2.sql | 3855 ++++++++++++++++ 111 files changed, 12795 insertions(+) create mode 100755 Dockerfile create mode 100644 Jenkinsfile create mode 100644 TODO create mode 100755 docker-build.sh create mode 100755 docker-run.sh create mode 100644 k8s/deployment.yaml create mode 100644 k8s/external-postgres-service.yaml create mode 100644 k8s/renovate-cronjob.yaml create mode 100644 k8s/renovate-secret.yaml create mode 100644 k8s/service.yaml create mode 100644 keys/keypair.pem create mode 100755 pom.xml create mode 100644 renovate.json create mode 100755 src/main/java/nl/connectedit/swiss/SwissApplication.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/AuthenticationController.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/AuthenticationRequest.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/AuthenticationResponse.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/Client.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/ClientRepository.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/JwtRequestFilter.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/JwtSecurityConfig.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/JwtTokenService.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/JwtUserDetails.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/JwtUserDetailsService.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/LoginCredentialsDto.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/UserDto.java create mode 100644 src/main/java/nl/connectedit/swiss/authentication/UserRoles.java create mode 100644 src/main/java/nl/connectedit/swiss/config/CorsConfig.java create mode 100644 src/main/java/nl/connectedit/swiss/config/JsonConfig.java create mode 100644 src/main/java/nl/connectedit/swiss/config/SecurityConfig.java create mode 100644 src/main/java/nl/connectedit/swiss/controller/PlayerController.java create mode 100644 src/main/java/nl/connectedit/swiss/controller/RegistrationController.java create mode 100644 src/main/java/nl/connectedit/swiss/controller/RestResponseEntityExceptionHandler.java create mode 100644 src/main/java/nl/connectedit/swiss/controller/TestController.java create mode 100755 src/main/java/nl/connectedit/swiss/controller/TournamentController.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/EventDivision.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/EventType.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/EventValidation.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/PlayerStrength.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/Sex.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/Status.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/TournamentDivision.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/TournamentStatus.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/TournamentValidation.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/Validation.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/AbstractEntity.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Event.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Game.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Group.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Match.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Player.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Registration.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Round.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Team.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/Tournament.java create mode 100644 src/main/java/nl/connectedit/swiss/domain/entity/TournamentPlayer.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/AbstractDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/EventDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/EventRegistrationDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/EventValidationDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/GameDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/GroupDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/MatchDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/PlayerDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/RegistrationDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/ResultDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/RoundDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/StandingsDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/StandingsEntry.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/StandingsEntryDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/TeamDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/TournamentDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/TournamentPlayerDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/TournamentRegistrationDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/TournamentValidationDto.java create mode 100644 src/main/java/nl/connectedit/swiss/dto/ValidationDto.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/DtoMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/EntityMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/EventMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/GameMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/GroupMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/MatchMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/PlayerMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/RegistrationMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/RoundMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/StandingsMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/TeamMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/TournamentMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerRegistrationMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/mapper/TournamentValidationMapper.java create mode 100644 src/main/java/nl/connectedit/swiss/repository/PlayerRepository.java create mode 100644 src/main/java/nl/connectedit/swiss/repository/RegistrationRepository.java create mode 100644 src/main/java/nl/connectedit/swiss/repository/TournamentRepository.java create mode 100644 src/main/java/nl/connectedit/swiss/service/PlayerService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/RegistrationService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/ServiceUtil.java create mode 100644 src/main/java/nl/connectedit/swiss/service/StandingsService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/TournamentDivideService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/TournamentDrawService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/TournamentPlayService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/TournamentService.java create mode 100644 src/main/java/nl/connectedit/swiss/service/TournamentValidationService.java create mode 100755 src/main/resources/application-local-postgres.yaml create mode 100755 src/main/resources/application-local.yaml create mode 100755 src/main/resources/application.yaml create mode 100644 src/main/resources/certs/private.pem create mode 100644 src/main/resources/certs/public.pem create mode 100644 src/main/resources/db/migration/V1__init.sql create mode 100755 src/main/resources/export.sql create mode 100755 src/main/resources/export2.sql diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..2e00a52 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM eclipse-temurin:21 + +COPY target/swiss*.jar swiss-backend.jar + +ENTRYPOINT ["java", "-jar", "swiss-backend.jar"] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e3bc188 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,63 @@ +// This Jenkinsfile defines a declarative pipeline +pipeline { + + options { + disableConcurrentBuilds() + } + agent any + +/* + agent { + docker { + image 'maven:3.9.3-eclipse-temurin-21' + args '-v $HOME/.m2:/root/.m2' + } + } + */ + + + // Defines the sequence of stages that will be executed + stages { + // This stage checks out the source code from the SCM (Source Code Management) system + stage('Checkout') { + steps { + // This command checks out the source code from the SCM into the Jenkins workspace + checkout scm + } + } + stage('Build') { + steps { + sh 'mvn -B clean package' + } + } + + stage('Docker Build') { + steps { + sh 'docker build -t upquark/swiss-backend:latest -t upquark/swiss-backend:${BUILD_NUMBER} .' + } + } + + stage('Push the Docker Image to DockerHUb') { + steps { + script { + withCredentials([string(credentialsId: 'c7783e4f-2f79-482f-885f-dfb39f8c02d3', variable: 'docker_hub')]) { + sh 'docker login -u upquark -p ${docker_hub}' + } + sh 'docker push upquark/swiss-backend:latest' + sh 'docker push upquark/swiss-backend:${BUILD_NUMBER}' + } + } + } + + stage('Deploy to Kubernetes') { + steps { + script { + kubeconfig(credentialsId: 'k3s-kubeconfig') { + sh 'cat k8s/deployment.yaml | sed "s/latest/$BUILD_NUMBER/g" | kubectl apply -n swiss -f -' + sh 'kubectl apply -f k8s/service.yaml -n swiss' + } + } + } + } + } +} \ No newline at end of file diff --git a/TODO b/TODO new file mode 100644 index 0000000..5046de6 --- /dev/null +++ b/TODO @@ -0,0 +1,7 @@ +https://stackoverflow.com/questions/76220171/kubernetes-continuous-deploy-plugin-not-found-in-jenkins +https://dev.to/amailath/secure-your-spring-boot-and-angular-application-with-jwt-authentication-a-comprehensive-guide-3o64 +https://bootify.io/spring-security/rest-api-spring-security-with-jwt.html + +https://access.crunchydata.com/documentation/postgres-operator/latest/tutorials/cluster-management/update-cluster + +Token refresh diff --git a/docker-build.sh b/docker-build.sh new file mode 100755 index 0000000..5401faf --- /dev/null +++ b/docker-build.sh @@ -0,0 +1 @@ +docker build -t swiss-backend:latest . diff --git a/docker-run.sh b/docker-run.sh new file mode 100755 index 0000000..126d0a2 --- /dev/null +++ b/docker-run.sh @@ -0,0 +1 @@ +docker run -p 8080:8080 -e SPRING_PROFILES_ACTIVE=local swiss-backend:latest diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..d6200d1 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: swiss-backend +spec: + replicas: 1 + selector: + matchLabels: + app: swiss-backend + template: + metadata: + labels: + app: swiss-backend + spec: + containers: + - name: swiss-backend + image: upquark/swiss-backend:latest + imagePullPolicy: Always + ports: + - containerPort: 8080 + env: +# - name: SPRING_PROFILES_ACTIVE +# value: local + - name: DB_URL + valueFrom: + secretKeyRef: + key: host + name: pg-pguser-swiss-user + - name: DB_USERNAME + valueFrom: + secretKeyRef: + key: user + name: pg-pguser-swiss-user + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + key: password + name: pg-pguser-swiss-user \ No newline at end of file diff --git a/k8s/external-postgres-service.yaml b/k8s/external-postgres-service.yaml new file mode 100644 index 0000000..6ea1f9f --- /dev/null +++ b/k8s/external-postgres-service.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + kubectl.kubernetes.io/last-applied-configuration: | + {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"external-postgres-svc","namespace":"swiss"},"spec":{"ports":[{"port":5432,"protocol":"TCP","targetPort":5432}]}} + creationTimestamp: "2024-09-20T11:29:41Z" + name: external-postgres-svc + namespace: swiss + resourceVersion: "82759" + uid: d6fbb75a-9526-4524-a044-df93c0682fd8 +spec: + clusterIP: 10.43.15.101 + clusterIPs: + - 10.43.15.101 + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - port: 5432 + protocol: TCP + targetPort: 5432 + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/k8s/renovate-cronjob.yaml b/k8s/renovate-cronjob.yaml new file mode 100644 index 0000000..c98ae61 --- /dev/null +++ b/k8s/renovate-cronjob.yaml @@ -0,0 +1,26 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: renovate +spec: + schedule: '@hourly' + concurrencyPolicy: Forbid + jobTemplate: + spec: + template: + spec: + containers: + - name: renovate + # Update this to the latest available and then enable Renovate on + # the manifest + image: renovate/renovate:38.80.0 + args: + - user/repo + # Environment Variables + env: + - name: LOG_LEVEL + value: debug + envFrom: + - secretRef: + name: renovate-env + restartPolicy: Never \ No newline at end of file diff --git a/k8s/renovate-secret.yaml b/k8s/renovate-secret.yaml new file mode 100644 index 0000000..330dcfb --- /dev/null +++ b/k8s/renovate-secret.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: renovate-env +type: Opaque +stringData: +# GITHUB_COM_TOKEN: 'any-personal-user-token-for-github-com-for-fetching-changelogs' + # You can set RENOVATE_AUTODISCOVER to true to run Renovate on all repos you have push access to + RENOVATE_AUTODISCOVER: 'false' + RENOVATE_ENDPOINT: 'https://git.tenvoorde.org/api/v1' + RENOVATE_GIT_AUTHOR: 'Renovate Bot ' + RENOVATE_PLATFORM: 'gitea' + RENOVATE_TOKEN: 'b9791f9de22856120ba85dd0adeb76178e5cb85f' \ No newline at end of file diff --git a/k8s/service.yaml b/k8s/service.yaml new file mode 100644 index 0000000..c259ee1 --- /dev/null +++ b/k8s/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: swiss-backend +spec: + type: NodePort + selector: + app: swiss-backend + ports: + - protocol: TCP + port: 8080 + nodePort: 30080 diff --git a/keys/keypair.pem b/keys/keypair.pem new file mode 100644 index 0000000..9915a8d --- /dev/null +++ b/keys/keypair.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCp5PMrGbzVKQSE +LSSkMoJnPUKu0f+ySIRe39qd5r1w07S6TAEqIwBdXwCdwTo8QnggNNxlC3j2pa0J +lKI3cNrnNitcs8oI0jQ4LN/HsN/cwp3V+m0sBaEVt9mZK0qSj2mxx+EnHpLF3Z+L +7EAGPlezpyGKsJHi1hgAXcbKdLcfC/h3g/TtIvPj7VfR86VGArY2VsZQWFsKvkQa +rGVosARQo0b2L/qsqYr9CvCEZ6gSTMS0+xr9Fc9AsYOyuzsw2zHvq8i/L8alK/Tt +CJobZK1O0Kedbv5R1gEU+NhGzrdZe1YwCCg5QZCk6j9NXN8tpMIFpeORsxXWxB72 +Dzc6+/FNAgMBAAECggEAB/mFeYkyfi339o1Y6jUtvlNXkTWtwyxYvExVKnLFgymI +0vLU3im472kRchY7Gc+D7H0WuE5+zdMOiYPWznPnbpFyHR6aVeoqBdYDZg/1Hhtr +hbsEy1tzSX3xApnP3QvKygvIE4pBmPSTc+Gxyqk7/CSU9DngCy4B/+hm96NdYiFd +yI5VByp+DMhk/dtgWFOHZcG4MvrRaLA8ZRnSkCa5QrL+la3lf4M9FJedpo9GvjG6 +c8M+pgLKMmw4bFDqfDyEpYhJxQaAqEMFaiBuMMDymI6OXpzBG92kflK7VvR4YBym +DUhqhmQ4qAe37Wr2vVob+Dsf39IuS+FWDNZSW6lrMQKBgQDnGVBv0Xv3+pb/NmqA +1sRJvhMtFaVkIKJuf1qK7SNzU5tCbNAfaJgQQVFNswnjpbS300T1ehNorsDeDi05 +WqeWdRPY/Qz+19AJ1UiCMUku/SWWN21byUQU4yven6mJ6rgkKbAv4E4VtpcG3q8B +W/aIL1KAHvEFJ3rI21QD4A+NvQKBgQC8M1rlXu64kKbw4D5KormMFvjkoROsXwn/ +eqN0wCN9avD7+LN/MUhqn7S0t0iQJRH+kaOjS6yl1v9JFI8bBLMQ1Uk1Mtpi4Mvl +AWtPLUYXxeP+zlS1ueBuDzRsNUGRqYM1MVlr7sko5gOAPQHHaDbNRYSqaskLtRR0 +/BjItmDC0QKBgGCySOPgxXxnUBMNk9bBBnTMoX111zRkK1MM2rfSrcitrQNIQHVD +8Iysp/ZY+cRVK57XOb11DPX6WR0Q1X9wHTtpVZqvl2ZyqsvSgHppYPPWXInUO1/y +gRg0TcDjEa9xlQccomoF8uZG9j6boqJw9mDZXC3bxIGhmVC95ROSBzAJAoGBAJHz +3dUuV0IpZF4/+e8V3YHIOwPL657tIarQ6Dzd2WglbHhsun+0r62I57KSxaKMLTVY +qygzwtPmNZruZ8ETVu+CCUFJi9XM8jNKc3c27Dn5jUSJrWY1ndic0BHvB0e4x3mU +KP4sdDLUlvh3145WwtFUzXsAT6RVrWTAMVRPJCFRAoGBAMEW8V36c+XJuD9qDvg3 +qG3uPaGS1IytkpSAtfSV+hXJ14N57L/oxPTVyrZKDgu0ic3KAHEJG/WN+SQPfaWT +zj8YnFFeSISRRo4Y1Q4Rg/Yer5fKVdkvGKPR9lCEhbxEBqZz4qSMUHGak1exjTeW +DapsPxEG0wEN8rMoNzYMNuc3 +-----END PRIVATE KEY----- diff --git a/pom.xml b/pom.xml new file mode 100755 index 0000000..7f11184 --- /dev/null +++ b/pom.xml @@ -0,0 +1,185 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.3.4 + + + nl.connected-it + swiss-backend + 0.0.1-SNAPSHOT + swiss-backend + Swiss Backend + + 21 + 21 + 21 + 1.6.0.RC1 + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-security + + + com.auth0 + java-jwt + 4.4.0 + + + com.fasterxml.jackson.datatype + jackson-datatype-hibernate5-jakarta + 2.17.2 + + + com.h2database + h2 + runtime + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-validation + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.postgresql + postgresql + runtime + + + org.flywaydb + flyway-core + 10.18.0 + + + org.flywaydb + flyway-database-postgresql + 10.18.0 + runtime + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.projectlombok + lombok + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.security + spring-security-test + test + + + + + + + org.hibernate.orm.tooling + hibernate-enhance-maven-plugin + ${hibernate.version} + + + enhance + + enhance + + + true + true + true + + + + + + org.graalvm.buildtools + native-maven-plugin + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + 21 + 21 + + + org.projectlombok + lombok + ${lombok.version} + + + + + + + org.flywaydb + flyway-maven-plugin + 10.18.0 + + jdbc:postgresql://localhost:5432/swiss?currentSchema=swiss + postgres + postgres + + + + + + + diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..aecea90 --- /dev/null +++ b/renovate.json @@ -0,0 +1,11 @@ +{ + "extends": [ + "config:base" + ], + "packageRules": [ + { + "updateTypes": ["minor", "patch", "pin", "digest"], + "automerge": false + } + ] +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/SwissApplication.java b/src/main/java/nl/connectedit/swiss/SwissApplication.java new file mode 100755 index 0000000..932d65e --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/SwissApplication.java @@ -0,0 +1,15 @@ +package nl.connectedit.swiss; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +@EnableTransactionManagement +public class SwissApplication { + + public static void main(String[] args) { + SpringApplication.run(SwissApplication.class, args); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/authentication/AuthenticationController.java b/src/main/java/nl/connectedit/swiss/authentication/AuthenticationController.java new file mode 100644 index 0000000..1d72ffc --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/AuthenticationController.java @@ -0,0 +1,46 @@ +package nl.connectedit.swiss.authentication; + +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.context.annotation.Profile; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.server.ResponseStatusException; + +@RestController +@ConditionalOnExpression("${security}") +@RequiredArgsConstructor +@CrossOrigin +public class AuthenticationController { + + private final JwtUserDetailsService jwtUserDetailsService; + + private final AuthenticationManager authenticationManager; + + private final JwtTokenService jwtTokenService; + + @PostMapping("/authenticate") + public AuthenticationResponse authenticate(@RequestBody @Valid final AuthenticationRequest authenticationRequest) { + try { + authenticationManager.authenticate(new UsernamePasswordAuthenticationToken( + authenticationRequest.getUsername(), authenticationRequest.getPassword())); + } catch (final BadCredentialsException ex) { + throw new ResponseStatusException(HttpStatus.UNAUTHORIZED); + } + + final UserDetails userDetails = jwtUserDetailsService.loadUserByUsername(authenticationRequest.getUsername()); + final AuthenticationResponse authenticationResponse = new AuthenticationResponse(); + authenticationResponse.setAccessToken(jwtTokenService.generateToken(userDetails)); + authenticationResponse.setUsername(authenticationRequest.getUsername()); + return authenticationResponse; + } +} diff --git a/src/main/java/nl/connectedit/swiss/authentication/AuthenticationRequest.java b/src/main/java/nl/connectedit/swiss/authentication/AuthenticationRequest.java new file mode 100644 index 0000000..f4e4748 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/AuthenticationRequest.java @@ -0,0 +1,20 @@ +package nl.connectedit.swiss.authentication; + +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class AuthenticationRequest { + + @NotNull + @Size(max = 255) + private String username; + + @NotNull + @Size(max = 255) + private String password; + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/AuthenticationResponse.java b/src/main/java/nl/connectedit/swiss/authentication/AuthenticationResponse.java new file mode 100644 index 0000000..49d6599 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/AuthenticationResponse.java @@ -0,0 +1,14 @@ +package nl.connectedit.swiss.authentication; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class AuthenticationResponse { + + private String accessToken; + + private String username; + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/Client.java b/src/main/java/nl/connectedit/swiss/authentication/Client.java new file mode 100644 index 0000000..5c92750 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/Client.java @@ -0,0 +1,13 @@ +package nl.connectedit.swiss.authentication; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class Client { + + private Long id; + + private String hash; +} diff --git a/src/main/java/nl/connectedit/swiss/authentication/ClientRepository.java b/src/main/java/nl/connectedit/swiss/authentication/ClientRepository.java new file mode 100644 index 0000000..10533b2 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/ClientRepository.java @@ -0,0 +1,23 @@ +package nl.connectedit.swiss.authentication; + +import org.springframework.stereotype.Repository; +import org.springframework.util.DigestUtils; + +import java.util.Optional; + +@Repository +public class ClientRepository { + + private static final String hash = "$2a$12$FjsFqFTorg0sXCiSISFS3.xvSCzmAATIcA7wh5w8WtQ7eYZC.H4UW"; + + Optional findByLogin(String username) { + if (username.equals("bcholten")) { + var client = new Client(); + client.setId(1L); + client.setHash(hash); + return Optional.of(client); + } else { + return Optional.empty(); + } + } +} diff --git a/src/main/java/nl/connectedit/swiss/authentication/JwtRequestFilter.java b/src/main/java/nl/connectedit/swiss/authentication/JwtRequestFilter.java new file mode 100644 index 0000000..d667a6c --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/JwtRequestFilter.java @@ -0,0 +1,57 @@ +package nl.connectedit.swiss.authentication; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import lombok.RequiredArgsConstructor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.context.annotation.Profile; +import org.springframework.http.HttpHeaders; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import java.io.IOException; + +@Component +@ConditionalOnExpression("${security}") +@RequiredArgsConstructor +public class JwtRequestFilter extends OncePerRequestFilter { + + private final JwtTokenService jwtTokenService; + + private final JwtUserDetailsService jwtUserDetailsService; + + @Override + protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, + final FilterChain chain) throws IOException, ServletException { + // look for Bearer auth header + final String header = request.getHeader(HttpHeaders.AUTHORIZATION); + if (header == null || !header.startsWith("Bearer ")) { + chain.doFilter(request, response); + return; + } + + final String token = header.substring(7); + final String username = jwtTokenService.validateTokenAndGetUsername(token); + if (username == null) { + // validation failed or token expired + chain.doFilter(request, response); + return; + } + + // set user details on spring security context + final JwtUserDetails userDetails = jwtUserDetailsService.loadUserByUsername(username); + final UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken( + userDetails, null, userDetails.getAuthorities()); + authentication.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); + SecurityContextHolder.getContext().setAuthentication(authentication); + + // continue with authenticated user + chain.doFilter(request, response); + } + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/JwtSecurityConfig.java b/src/main/java/nl/connectedit/swiss/authentication/JwtSecurityConfig.java new file mode 100644 index 0000000..ee79534 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/JwtSecurityConfig.java @@ -0,0 +1,62 @@ +package nl.connectedit.swiss.authentication; + +import lombok.RequiredArgsConstructor; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.http.SessionCreationPolicy; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +import static org.springframework.security.config.Customizer.withDefaults; + +@Configuration +@ConditionalOnExpression("${security}") +@EnableWebSecurity +@RequiredArgsConstructor +public class JwtSecurityConfig { + + private final JwtRequestFilter jwtRequestFilter; + + @Bean + BCryptPasswordEncoder passwordEncoder() { + return new BCryptPasswordEncoder(); + } + + @Bean + public AuthenticationManager authenticationManager( + final AuthenticationConfiguration authenticationConfiguration) throws Exception { + return authenticationConfiguration.getAuthenticationManager(); + } + + @Bean + public SecurityFilterChain configure(final HttpSecurity http) throws Exception { + return http.cors(withDefaults()) + .csrf((csrf) -> csrf.disable()) + .authorizeHttpRequests((authorize) -> authorize + .requestMatchers("/", "/authenticate", "/testdata").permitAll() + .anyRequest().hasAuthority(UserRoles.ROLE_USER)) + .sessionManagement((session) -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) + .addFilterBefore(jwtRequestFilter, UsernamePasswordAuthenticationFilter.class) + .build(); + } + + @Bean + public WebMvcConfigurer corsConfigurer() { + return new WebMvcConfigurer() { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedMethods("HEAD", "GET", "PUT", "POST", "DELETE", "PATCH"); + } + }; + } + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/JwtTokenService.java b/src/main/java/nl/connectedit/swiss/authentication/JwtTokenService.java new file mode 100644 index 0000000..2d7b140 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/JwtTokenService.java @@ -0,0 +1,51 @@ +package nl.connectedit.swiss.authentication; + +import com.auth0.jwt.JWT; +import com.auth0.jwt.JWTVerifier; +import com.auth0.jwt.algorithms.Algorithm; +import com.auth0.jwt.exceptions.JWTVerificationException; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.stereotype.Service; + +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.time.Duration; +import java.time.Instant; + +@Service +@ConditionalOnExpression("${security}") +public class JwtTokenService { + + private static final Duration JWT_TOKEN_VALIDITY = Duration.ofDays(7); + + private final Algorithm rsa256; + private final JWTVerifier verifier; + + public JwtTokenService(@Value("classpath:certs/public.pem") final RSAPublicKey publicKey, + @Value("classpath:certs/private.pem") final RSAPrivateKey privateKey) { + this.rsa256 = Algorithm.RSA256(publicKey, privateKey); + this.verifier = JWT.require(this.rsa256).build(); + } + + public String generateToken(final UserDetails userDetails) { + final Instant now = Instant.now(); + return JWT.create() + .withSubject(userDetails.getUsername()) + .withIssuer("app") + .withIssuedAt(now) + .withExpiresAt(now.plusMillis(JWT_TOKEN_VALIDITY.toMillis())) + .sign(this.rsa256); + } + + public String validateTokenAndGetUsername(final String token) { + try { + return verifier.verify(token).getSubject(); + } catch (final JWTVerificationException verificationEx) { +// log.warn("token invalid: {}", verificationEx.getMessage()); + return null; + } + } + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/JwtUserDetails.java b/src/main/java/nl/connectedit/swiss/authentication/JwtUserDetails.java new file mode 100644 index 0000000..f33dd3f --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/JwtUserDetails.java @@ -0,0 +1,19 @@ +package nl.connectedit.swiss.authentication; + +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; + +import java.util.Collection; + +public class JwtUserDetails extends User { + + public final Long id; + + public JwtUserDetails(final Long id, final String username, final String hash, + final Collection authorities) { + super(username, hash, authorities); + this.id = id; + } + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/JwtUserDetailsService.java b/src/main/java/nl/connectedit/swiss/authentication/JwtUserDetailsService.java new file mode 100644 index 0000000..189cf1b --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/JwtUserDetailsService.java @@ -0,0 +1,27 @@ +package nl.connectedit.swiss.authentication; + +import lombok.RequiredArgsConstructor; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; + +@Service +@RequiredArgsConstructor +public class JwtUserDetailsService implements UserDetailsService { + + private final ClientRepository clientRepository; + + @Override + public JwtUserDetails loadUserByUsername(final String username) { + final Client client = clientRepository.findByLogin(username).orElseThrow( + () -> new UsernameNotFoundException("User " + username + " not found")); + final List roles = Collections.singletonList(new SimpleGrantedAuthority(UserRoles.ROLE_USER)); + return new JwtUserDetails(client.getId(), username, client.getHash(), roles); + } + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/authentication/LoginCredentialsDto.java b/src/main/java/nl/connectedit/swiss/authentication/LoginCredentialsDto.java new file mode 100644 index 0000000..4f1f329 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/LoginCredentialsDto.java @@ -0,0 +1,13 @@ +package nl.connectedit.swiss.authentication; + +import lombok.Data; + +@Data +public class LoginCredentialsDto { + + private String username; + + private String password; + + private String ipAddres; +} diff --git a/src/main/java/nl/connectedit/swiss/authentication/UserDto.java b/src/main/java/nl/connectedit/swiss/authentication/UserDto.java new file mode 100644 index 0000000..c4eb210 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/UserDto.java @@ -0,0 +1,16 @@ +package nl.connectedit.swiss.authentication; + +import lombok.Data; + +@Data +public class UserDto { + + private String username; + + private String token; + + private String refreshToken; + + private String ipAddress; + +} diff --git a/src/main/java/nl/connectedit/swiss/authentication/UserRoles.java b/src/main/java/nl/connectedit/swiss/authentication/UserRoles.java new file mode 100644 index 0000000..931dd23 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/authentication/UserRoles.java @@ -0,0 +1,8 @@ +package nl.connectedit.swiss.authentication; + +public class UserRoles { + + public static final String USER = "USER"; + public static final String ROLE_USER = "ROLE_" + USER; + +} diff --git a/src/main/java/nl/connectedit/swiss/config/CorsConfig.java b/src/main/java/nl/connectedit/swiss/config/CorsConfig.java new file mode 100644 index 0000000..cf4f1d1 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/config/CorsConfig.java @@ -0,0 +1,25 @@ +package nl.connectedit.swiss.config; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +//@Component +public class CorsConfig extends OncePerRequestFilter { + + @Override + protected void doFilterInternal(final HttpServletRequest request, final HttpServletResponse response, + final FilterChain filterChain) throws ServletException, IOException { + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT, PATCH, HEAD"); + response.addHeader("Access-Control-Allow-Headers", "Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers"); + response.addHeader("Access-Control-Expose-Headers", "Access-Control-Allow-Origin, Access-Control-Allow-Credentials"); + response.addHeader("Access-Control-Allow-Credentials", "true"); + response.addIntHeader("Access-Control-Max-Age", 10); + filterChain.doFilter(request, response); + } +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/config/JsonConfig.java b/src/main/java/nl/connectedit/swiss/config/JsonConfig.java new file mode 100644 index 0000000..33cfa6e --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/config/JsonConfig.java @@ -0,0 +1,14 @@ +package nl.connectedit.swiss.config; + +import com.fasterxml.jackson.databind.Module; +import com.fasterxml.jackson.datatype.hibernate5.jakarta.Hibernate5JakartaModule; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class JsonConfig { + @Bean + public Module hibernateModule() { + return new Hibernate5JakartaModule(); + } +} diff --git a/src/main/java/nl/connectedit/swiss/config/SecurityConfig.java b/src/main/java/nl/connectedit/swiss/config/SecurityConfig.java new file mode 100644 index 0000000..846858c --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/config/SecurityConfig.java @@ -0,0 +1,26 @@ +package nl.connectedit.swiss.config; + +import jakarta.servlet.DispatcherType; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.web.SecurityFilterChain; + +//@Configuration +//@EnableWebSecurity +public class SecurityConfig { + +// @Bean + public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception { + http + .csrf(AbstractHttpConfigurer::disable) + .authorizeHttpRequests(auth -> auth.anyRequest().permitAll()); +// .authorizeHttpRequests(request -> { +// request.dispatcherTypeMatchers(DispatcherType.FORWARD).permitAll(); +// request.requestMatchers("/error").permitAll(); +// }); + return http.build(); + } +} diff --git a/src/main/java/nl/connectedit/swiss/controller/PlayerController.java b/src/main/java/nl/connectedit/swiss/controller/PlayerController.java new file mode 100644 index 0000000..06ee06f --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/controller/PlayerController.java @@ -0,0 +1,53 @@ +package nl.connectedit.swiss.controller; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.dto.PlayerDto; +import nl.connectedit.swiss.mapper.PlayerMapper; +import nl.connectedit.swiss.service.PlayerService; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@CrossOrigin +@RequiredArgsConstructor +public class PlayerController { + + private final PlayerService playerService; + + private final PlayerMapper playerMapper; + + @GetMapping("/players") + public ResponseEntity> getPlayers() { + return ResponseEntity.ok(playerService.findAllPlayers() + .stream() + .map(playerMapper::toDto) + .toList()); + } + + @GetMapping("/players/{id}") + public ResponseEntity getPlayer(@PathVariable Long id) { + return ResponseEntity.ok(playerMapper.toDto(playerService.findPlayerById(id))); + } + + @PostMapping("/players") + public ResponseEntity createPlayer(@RequestBody PlayerDto playerDto) { + Player player; + try { + player = playerMapper.toEntity(playerDto); + } catch (NullPointerException e) { + return ResponseEntity.badRequest().build(); + } + return ResponseEntity.ok(playerMapper.toDto(playerService.savePlayer(player))); + } + + @PutMapping("/players/{id}") + public ResponseEntity updatePlayer(@PathVariable("id") Long id, @RequestBody PlayerDto playerDto) { + var player = playerMapper.toEntity(playerDto); + player.setId(id); + return ResponseEntity.ok(playerMapper.toDto(playerService.savePlayer(player))); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/controller/RegistrationController.java b/src/main/java/nl/connectedit/swiss/controller/RegistrationController.java new file mode 100644 index 0000000..3c757e9 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/controller/RegistrationController.java @@ -0,0 +1,53 @@ +package nl.connectedit.swiss.controller; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.dto.TournamentRegistrationDto; +import nl.connectedit.swiss.mapper.TournamentPlayerRegistrationMapper; +import nl.connectedit.swiss.service.PlayerService; +import nl.connectedit.swiss.service.RegistrationService; +import nl.connectedit.swiss.service.TournamentService; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RestController +@CrossOrigin +@RequiredArgsConstructor +public class RegistrationController { + + private final PlayerService playerService; + + private final RegistrationService registrationService; + + private final TournamentService tournamentService; + + private final TournamentPlayerRegistrationMapper tournamentPlayerRegistrationMapper; + + @GetMapping("/players/{playerId}/registrations") + public List getRegistrationsForPlayer(@PathVariable Long playerId) { + var player = playerService.findPlayerById(playerId); + var tournaments = tournamentService.findAllTournaments(); + + return tournamentPlayerRegistrationMapper.mapToDto(tournaments, player); + } + + @PostMapping("/players/{playerId}/registrations/{tournamentId}") + @ResponseStatus(value = HttpStatus.NO_CONTENT) + public TournamentRegistrationDto registerTournamentRegistrations(@PathVariable Long playerId, @PathVariable Long tournamentId, @RequestBody TournamentRegistrationDto tournamentRegistrationDto) { + var player = playerService.findPlayerById(playerId); + var tournament = tournamentService.findTournamentById(tournamentId); + for (var eventRegistration : tournamentRegistrationDto.getEvents()) { + registrationService.updateOrAddRegistrations(eventRegistration, tournament, player); + } + + return tournamentPlayerRegistrationMapper.mapToTournamentRegistrationDto(tournament, player); + } +} diff --git a/src/main/java/nl/connectedit/swiss/controller/RestResponseEntityExceptionHandler.java b/src/main/java/nl/connectedit/swiss/controller/RestResponseEntityExceptionHandler.java new file mode 100644 index 0000000..defdd4a --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/controller/RestResponseEntityExceptionHandler.java @@ -0,0 +1,21 @@ +package nl.connectedit.swiss.controller; + +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.AccessDeniedException; +import org.springframework.web.bind.annotation.ControllerAdvice; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.context.request.WebRequest; +import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; + +//@ControllerAdvice +public class RestResponseEntityExceptionHandler + extends ResponseEntityExceptionHandler { + + @ExceptionHandler({AccessDeniedException.class}) + public ResponseEntity handleAccessDeniedException( + Exception ex, WebRequest request) { + return new ResponseEntity(ex.getMessage(), new HttpHeaders(), HttpStatus.FORBIDDEN); + } +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/controller/TestController.java b/src/main/java/nl/connectedit/swiss/controller/TestController.java new file mode 100644 index 0000000..c18a71b --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/controller/TestController.java @@ -0,0 +1,507 @@ +package nl.connectedit.swiss.controller; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.annotation.PostConstruct; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.transaction.Transactional; +import lombok.RequiredArgsConstructor; +import lombok.SneakyThrows; +import nl.connectedit.swiss.domain.*; +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.domain.entity.Registration; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.domain.entity.TournamentPlayer; +import nl.connectedit.swiss.dto.*; +import nl.connectedit.swiss.service.*; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestTemplate; + +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.time.LocalDate; +import java.time.Month; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.ThreadLocalRandom; + +import static nl.connectedit.swiss.domain.PlayerStrength.*; + +@RestController +@CrossOrigin +@RequiredArgsConstructor +public class TestController { + + private final TournamentService tournamentService; + + private final PlayerService playerService; + + private final TournamentDivideService tournamentDivideService; + private final TournamentDrawService tournamentDrawService; + private final TournamentPlayService tournamentPlayService; + + private final ObjectMapper objectMapper; + private final RestTemplateBuilder restTemplateBuilder; + private RestTemplate restTemplate; + + private final PlayerController playerController; + + private String authorizationHeader; + + @Bean + public RestTemplate restTemplate(RestTemplateBuilder builder) { + return builder.build(); + } + + @GetMapping("/testdata") +// @PostConstruct +// @Transactional + public void init(@RequestHeader(name = "Authorization", required = false) String authorizationHeader) { + this.authorizationHeader = authorizationHeader; + + restTemplate = restTemplateBuilder.build(); + + var tournament = createTournament(); + + getMales().forEach(player -> savePlayer(player, Sex.M)); + getFemales().forEach(player -> savePlayer(player, Sex.V)); + + registerForSingles(tournament); + registerForDoubles(tournament); + + + } + + @SuppressWarnings("DataFlowIssue") + private List getPlayers() { + var headers = new HttpHeaders(); + headers.add("Authorization", authorizationHeader); + var entity = new HttpEntity<>(headers); + +// return Arrays.asList(restTemplate.getForEntity("http://localhost:8080/players", PlayerDto[].class).getBody()); + return Arrays.asList(restTemplate.exchange("http://localhost:8080/players", HttpMethod.GET, entity, PlayerDto[].class).getBody()); + } + + private void registerForSingles(TournamentDto tournament) { + var eventIdHE = tournament.getEvents().stream().filter(event -> event.getType().equals("HE")).findFirst().get().getId(); + var eventIdDE = tournament.getEvents().stream().filter(event -> event.getType().equals("DE")).findFirst().get().getId(); + + for (var player : getPlayers()) { + var tournamentRegistrationDto = new TournamentRegistrationDto(); + tournamentRegistrationDto.setId(tournament.getId()); + var eventRegistrationDto = new EventRegistrationDto(); + eventRegistrationDto.setId(player.getSex().equals("M") ? eventIdHE : eventIdDE); + eventRegistrationDto.setRegistered(true); + eventRegistrationDto.setPlayer(player.getId()); + eventRegistrationDto.setType(player.getSex().equals("M") ? "HE" : "DE"); + tournamentRegistrationDto.setEvents(List.of(eventRegistrationDto)); + + var headers = new HttpHeaders(); + headers.add("Authorization", authorizationHeader); + var entity = new HttpEntity<>(tournamentRegistrationDto, headers); + restTemplate.postForObject("http://localhost:8080/players/%d/registrations/%d".formatted(player.getId(), tournament.getId()), entity, TournamentRegistrationDto.class); + } + } + + private void registerForDoubles(TournamentDto tournament) { + var males = getPlayers().stream().filter(p -> p.getSex().equals("M")).toArray(PlayerDto[]::new); + var females = getPlayers().stream().filter(p -> p.getSex().equals("V")).toArray(PlayerDto[]::new); + + for (int i = 0; i <= 6; i++) { + registerForDoubles(tournament, males[i * 2], males[i * 2 + 1]); + registerForDoubles(tournament, males[i * 2 + 1], males[i * 2]); + } + for (int i = 0; i <= 8; i++) { + registerForDoubles(tournament, females[i * 2], females[i * 2 + 1]); + registerForDoubles(tournament, females[i * 2 + 1], females[i * 2]); + } + for (int i = 18; i <= 29; i++) { + registerForDoubles(tournament, males[i], females[i]); + registerForDoubles(tournament, females[i], males[i]); + } + + } + + private void registerForDoubles(TournamentDto tournament, PlayerDto player, PlayerDto partner) { + var eventType = player.getSex().equals(partner.getSex()) ? (player.getSex().equals("M") ? "HD" : "DD") : "GD"; + + var eventId = tournament.getEvents().stream().filter(event -> event.getType().equals(eventType)).findFirst().get().getId(); + +// for (var player : getPlayers()) { + var tournamentRegistrationDto = new TournamentRegistrationDto(); + tournamentRegistrationDto.setId(tournament.getId()); + var eventRegistrationDto = new EventRegistrationDto(); + eventRegistrationDto.setId(eventId); + eventRegistrationDto.setRegistered(true); + eventRegistrationDto.setPlayer(player.getId()); + eventRegistrationDto.setPartner(partner.getId()); + eventRegistrationDto.setType(eventType); + tournamentRegistrationDto.setEvents(List.of(eventRegistrationDto)); + + var headers = new HttpHeaders(); + headers.add("Authorization", authorizationHeader); + var entity = new HttpEntity<>(tournamentRegistrationDto, headers); + restTemplate.postForObject("http://localhost:8080/players/%d/registrations/%d".formatted(player.getId(), tournament.getId()), entity, TournamentRegistrationDto.class); +// } + + } + + private TournamentDto createTournament() { + var headers = new HttpHeaders(); + headers.add("Authorization", authorizationHeader); + var entity = new HttpEntity<>(getTournament(), headers); + return restTemplate.postForObject("http://localhost:8080/tournaments", entity, TournamentDto.class); + } + + private TournamentDto getTournament() { + var tournamentDto = new TournamentDto(); + tournamentDto.setName("Testtoernooi"); + tournamentDto.setDate("14-12-2024"); + tournamentDto.setStatus("UPCOMING"); + tournamentDto.setMaxEvents(2L); + tournamentDto.setCourts(9L); + tournamentDto.setCostsPerEvent(List.of(6f, 10f, 0f)); + return tournamentDto; + } + + private void savePlayer(String firstName, Sex sex) { + Random random = new Random(); + + String[] lastNames = { + "Meedendorp", "Holstege", "Goedhart", "Zijlma", "Duursma", "Keizer", "Verschoor", + "Mulder", "Koers", "Duindam", "Castelein", "Coemans", "Huijbers", "Kelder", + "Stein", "Rakhorst", "Brugman", "Seinen", "Mayer", "Gijsman", "Kingma", + "Jansen", "Westerik", "Brehler", "Ebbers", "Lensink", "Lups", "Verboom" + }; + + String[] clubs = { + "BC Holten", "BC Reflex", "ZBC", "WSV Apeldoorn", "BC IJsselstad", "Flits", "ELO United", "BC Kwiek" + }; + + var playerDto = new PlayerDto(); + playerDto.setFirstName(firstName); + playerDto.setLastName(lastNames[random.nextInt(lastNames.length)]); + playerDto.setClub(clubs[random.nextInt(clubs.length)]); + playerDto.setSex(sex.name()); + var birthday = randomDate(LocalDate.of(1950, 1, 1), LocalDate.of(2010, 1, 1)).format(DateTimeFormatter.ofPattern("dd-MM-yyyy")); + playerDto.setBirthday(birthday); + playerDto.setPhoneNumber("0612345678"); + playerDto.setEmail("aaaa@bbb.cc"); + playerDto.setStrength(getRandomStrength().name()); + + var headers = new HttpHeaders(); + headers.add("Authorization", authorizationHeader); + var entity = new HttpEntity<>(playerDto, headers); + restTemplate.postForObject("http://localhost:8080/players", entity, PlayerDto.class); + } + + private List getMales() { + return List.of("Michel", "Eric", "Leon", "Luuk", "Jeffrey", "Jason", "Oleg", "Gerjan", "Gerard", "Henk", + "Peter", "Gerrit", "Wilco", "Guido", "Sander", "Roy", "Yafiq", "Martijn", "Dick", "Willem", "Layo", + "Thomas", "Gerben", "Bert", "Bart", "Nico", "Jan", "Diederik", "Gert", "Dennis", "Pieter"); + } + + private List getFemales() { + return List.of("Amber", "Lisa", "Vanja", "Evelien", "Daphne", "Willemijn", "Miranda", "Inge", "Esmee", + "Joanne", "Laura", "Nienke", "Patty", "Rosan", "Vera", "Hedwig", "Lois", "Liedewij", "Gera", "Carolien", + "Anne", "Dominique", "Linda", "Esther", "Marilyn", "Ilse", "Emily", "Eva", "Kitty", "Floor", "Tess", "Fenna"); + } + + private PlayerStrength getRandomStrength() { + var random = new Random().nextInt(0, 12); + + return switch(random) { + case 0 -> D5; + case 1, 2 -> D6; + case 3, 4, 5 -> D7; + case 6, 7 -> D8; + case 8, 9 -> D9; + default -> DR; + }; + } + + public static LocalDate randomDate(LocalDate startInclusive, LocalDate endExclusive) { + long startEpochDay = startInclusive.toEpochDay(); + long endEpochDay = endExclusive.toEpochDay(); + long randomDay = ThreadLocalRandom + .current() + .nextLong(startEpochDay, endEpochDay); + + return LocalDate.ofEpochDay(randomDay); + } + + +/* + private void deRest() { + + var malePlayers = List.of( + savePlayer("Michel", Sex.M), + savePlayer("Eric", Sex.M), + savePlayer("Leon", Sex.M), + savePlayer("Luuk", Sex.M), + savePlayer("Jeffrey", Sex.M), + savePlayer("Jason", Sex.M), + savePlayer("Oleg", Sex.M), + savePlayer("Gerjan", Sex.M), + savePlayer("Gerard", Sex.M), + savePlayer("Henk", Sex.M), + savePlayer("Peter", Sex.M), + savePlayer("Gerrit", Sex.M), + savePlayer("Wilco", Sex.M), + savePlayer("Guido", Sex.M), + savePlayer("Sander", Sex.M), + savePlayer("Roy", Sex.M), + + savePlayer("Yafiq", Sex.M), + savePlayer("Martijn", Sex.M), + savePlayer("Dick", Sex.M), + savePlayer("Willem", Sex.M), + savePlayer("Layo", Sex.M), + savePlayer("Thomas", Sex.M), + savePlayer("Gerben", Sex.M), + savePlayer("Bert", Sex.M), + savePlayer("Bart", Sex.M), + savePlayer("Nico", Sex.M), + savePlayer("Jan", Sex.M), + savePlayer("Diederik", Sex.M), + savePlayer("Gert", Sex.M), + savePlayer("Dennis", Sex.M), + savePlayer("Pieter", Sex.M) + ); + + var femalePlayers = List.of( + savePlayer("Amber", Sex.V), + savePlayer("Lisa", Sex.V), + savePlayer("Vanja", Sex.V), + savePlayer("Evelien", Sex.V), + savePlayer("Daphne", Sex.V), + savePlayer("Willemijn", Sex.V), + savePlayer("Miranda", Sex.V), + savePlayer("Inge", Sex.V), + savePlayer("Esmee", Sex.V), + savePlayer("Joanne", Sex.V), + savePlayer("Laura", Sex.V), + savePlayer("Nienke", Sex.V), + savePlayer("Patty", Sex.V), + savePlayer("Rosan", Sex.V), + savePlayer("Vera", Sex.V), + savePlayer("Hedwig", Sex.V), + + savePlayer("Lois", Sex.V), + savePlayer("Liedewij", Sex.V), + savePlayer("Gera", Sex.V), + savePlayer("Carolien", Sex.V), + savePlayer("Anne", Sex.V), + savePlayer("Dominique", Sex.V), + savePlayer("Linda", Sex.V), + savePlayer("Esther", Sex.V), + savePlayer("Marilyn", Sex.V), + savePlayer("Ilse", Sex.V), + savePlayer("Emily", Sex.V), + savePlayer("Eva", Sex.V), + savePlayer("Kitty", Sex.V), + savePlayer("Floor", Sex.V), + savePlayer("Tess", Sex.V), + savePlayer("Fenna", Sex.V) + ); + + malePlayers.forEach(player -> registerForSingles(tournamentId, player)); + femalePlayers.forEach(player -> registerForSingles(tournamentId, player)); + + malePlayers = new ArrayList<>(malePlayers); + malePlayers.add(savePlayer("Rolf", Sex.M)); + + for (var i = 0; i < 14; i += 2) { + registerForDoubles(tournamentId, malePlayers.get(i), malePlayers.get(i + 1)); + registerForDoubles(tournamentId, malePlayers.get(i + 1), malePlayers.get(i)); + } + for (var i = 0; i < 16; i += 2) { + registerForDoubles(tournamentId, femalePlayers.get(i), femalePlayers.get(i + 1)); + registerForDoubles(tournamentId, femalePlayers.get(i + 1), femalePlayers.get(i)); + } + for (var i = 16; i < malePlayers.size(); i++) { + registerForDoubles(tournamentId, malePlayers.get(i), femalePlayers.get(i)); + registerForDoubles(tournamentId, femalePlayers.get(i), malePlayers.get(i)); + } + + divideTournament(tournamentId); + drawTournament(tournamentId); +// startRound(2L, 1L); +// playRound(2L, 0, 0); + + startRound(tournamentId, 2L); + playRound(tournamentId, 1, 0); + + + finishRound(tournamentId, 2L); + newRound(tournamentId, 2L); + + startRound(tournamentId, 8L); + playRound(tournamentId, 1, 1); + + if (1==1) return; + + finishRound(tournamentId, 8L); + newRound(tournamentId, 2L); + + startRound(tournamentId, 9L); + playRound(tournamentId, 1, 2); + finishRound(tournamentId, 9L); + newRound(tournamentId, 2L); + + startRound(tournamentId, 10L); + playRound(tournamentId, 1, 3); +// finishRound(2L, 10L); + + } + + private void addToTournament(Long tournamentId, Player player) { + var tournament = tournamentService.findTournamentById(tournamentId); + TournamentPlayer tournamentPlayer = new TournamentPlayer(); + tournamentPlayer.setTournament(tournament); + tournamentPlayer.setPlayer(player); + tournament.getTournamentPlayers().add(tournamentPlayer); + tournamentService.saveTournament(tournament); + } + + private void divideTournament(Long tournamentId) { + var tournament = tournamentService.findTournamentById(tournamentId); + tournamentDivideService.divide(tournament); + } + + private void drawTournament(Long tournamentId) { + var tournament = tournamentService.findTournamentById(tournamentId); + tournamentDrawService.draw(tournament); + } + + private void playRound(long tournamentId, int group, int round) { + var tournament = tournamentService.findTournamentById(tournamentId); + for (var match : tournament.getEvents().get(0).getGroups().get(group).getRounds().get(round).getMatches()) { + tournamentPlayService.startMatch(tournament, match.getId(), 1L); + } + + for (var match : tournament.getEvents().get(0).getGroups().get(group).getRounds().get(round).getMatches()) { + tournament = tournamentService.findTournamentById(tournamentId); + var resultDto = new ResultDto(); + resultDto.getGames().add(getRandomGame()); + resultDto.getGames().add(getRandomGame()); + resultDto.setMatchId(match.getId()); + tournamentPlayService.saveResult(tournament, match.getId(), resultDto); + } + } + + private GameDto getRandomGame() { + Random random = new Random(); + + var gameDto = new GameDto(); + gameDto.setScore1(21L); + gameDto.setScore2(random.nextLong(19)); + + return gameDto; + } + + private void finishRound(long tournamentId, long roundId) { + var tournament = tournamentService.findTournamentById(tournamentId); + tournamentPlayService.finishRound(tournament, roundId); + } + + private void newRound(long tournamentId, long groupId) { + var tournament = tournamentService.findTournamentById(tournamentId); + tournamentPlayService.newRound(tournament, groupId); + } + + private void startRound(long tournamentId, long roundId) { + var tournament = tournamentService.findTournamentById(tournamentId); + tournamentPlayService.startRound(tournament, roundId); + } + +// private void saveTournament1() { +// var tournament = new Tournament(); +// tournament.setName("Zwitsers Laddersysteem BC Holten 2023"); +// tournament.setDate(LocalDate.of(2023, Month.DECEMBER, 12)); +// tournament.setStatus(TournamentStatus.CLOSED); +// tournamentService.saveTournament(tournament); +// } + + + private Long saveTournament() { + var tournament = new Tournament(); + tournament.setName("Testtoernooi"); + tournament.setDate(LocalDate.of(2024, Month.DECEMBER, 14)); + tournament.setStatus(TournamentStatus.UPCOMING); + tournament.setMaxEvents(2L); + tournament.setCourts(9L); + tournament.setCostsPerEvent(List.of(6f, 10f)); + tournamentService.saveTournament(tournament); + return tournament.getId(); + } + + private void registerForSingles(Long tournamentId, Player player) { + var tournament = tournamentService.findTournamentById(tournamentId); + var registration = new Registration(); + registration.setPlayer(player); + var event = tournament.getEventByType(player.getSex() == Sex.M ? EventType.HE : EventType.DE); + registration.setPartner(null); + registration.setTournament(tournament); + registration.setEvent(event); + if (event.getRegistrations() == null) event.setRegistrations(new ArrayList<>()); + event.getRegistrations().add(registration); +// player.getRegistrations().add(registration); + tournamentService.saveTournament(tournament); + } + + private void registerForDoubles(Long tournamentId, Player player, Player partner) { + var tournament = tournamentService.findTournamentById(tournamentId); + var registration = new Registration(); + registration.setPlayer(player); + registration.setPartner(partner); + var event = tournament.getEventByType( + player.getSex() == partner.getSex() ? + (player.getSex() == Sex.M ? EventType.HD : EventType.DD) : EventType.GD); + registration.setTournament(tournament); + registration.setEvent(event); + event.getRegistrations().add(registration); +// player.getRegistrations().add(registration); + tournamentService.saveTournament(tournament); + } + +// private Player savePlayer(String firstName, Sex sex) { +// Random random = new Random(); +// +// String[] lastNames = { +// "Meedendorp", "Holstege", "Goedhart", "Zijlma", "Duursma", "Keizer", "Verschoor", +// "Mulder", "Koers", "Duindam", "Castelein", "Coemans", "Huijbers", "Kelder", +// "Stein", "Rakhorst", "Brugman", "Seinen", "Mayer", "Gijsman", "Kingma", +// "Jansen", "Westerik", "Brehler", "Ebbers", "Lensink", "Lups", "Verboom" +// }; +// +// String[] clubs = { +// "BC Holten", "BC Reflex", "ZBC", "WSV Apeldoorn", "BC IJsselstad", "Flits", "ELO United", "BC Kwiek" +// }; +// +// var player = new Player(); +// player.setFirstName(firstName); +// player.setLastName(lastNames[random.nextInt(lastNames.length)]); +// player.setClub(clubs[random.nextInt(clubs.length)]); +// player.setSex(sex); +// player.setBirthday(randomDate(LocalDate.of(1950, 1, 1), LocalDate.of(2010, 1, 1))); +// player.setPhoneNumber("0612345678"); +// player.setEmail("aaaa@bbb.cc"); +// player.setStrength(getRandomStrength()); +// +// playerService.savePlayer(player); +// return player; +// } +*/ + +} diff --git a/src/main/java/nl/connectedit/swiss/controller/TournamentController.java b/src/main/java/nl/connectedit/swiss/controller/TournamentController.java new file mode 100755 index 0000000..f40e487 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/controller/TournamentController.java @@ -0,0 +1,184 @@ +package nl.connectedit.swiss.controller; + +import jakarta.transaction.Transactional; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.dto.ResultDto; +import nl.connectedit.swiss.dto.TournamentDto; +import nl.connectedit.swiss.dto.TournamentValidationDto; +import nl.connectedit.swiss.mapper.TournamentMapper; +import nl.connectedit.swiss.mapper.TournamentValidationMapper; +import nl.connectedit.swiss.service.*; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Objects; + +@RestController +@CrossOrigin +@RequiredArgsConstructor +public class TournamentController { + + private final TournamentService tournamentService; + + private final TournamentMapper tournamentMapper; + + private final TournamentValidationService tournamentValidationService; + + private final TournamentValidationMapper tournamentValidationMapper; + + private final TournamentDivideService tournamentDivideService; + + private final TournamentDrawService tournamentDrawService; + + private final TournamentPlayService tournamentPlayService; + + @GetMapping("/tournaments") + public ResponseEntity> getTournaments(@RequestParam(value = "status", required = false) TournamentStatus status) { + List tournaments; + + if (Objects.nonNull(status)) { + tournaments = tournamentService.findAllTournamentsWithStatus(status); + } else { + tournaments = tournamentService.findAllTournaments(); + } + + return ResponseEntity.ok(tournaments + .stream() + .map(tournamentMapper::toDto) + .toList()); + } + + @GetMapping("/tournaments/{id}") + @Transactional + public ResponseEntity getTournament(@PathVariable Long id) { + var tournament = tournamentService.findTournamentById(id); + + if (tournament == null) { + return ResponseEntity.notFound().build(); + } + + return ResponseEntity.ok(tournamentMapper.toDto(tournament)); + } + + @PostMapping("/tournaments") + public ResponseEntity createTournament(@RequestBody TournamentDto tournamentDto) { + var tournament = tournamentMapper.toEntity(tournamentDto); + return ResponseEntity.ok(tournamentMapper.toDto(tournamentService.saveTournament(tournament))); + } + + @PutMapping("/tournaments/{id}") + public ResponseEntity updateTournament(@PathVariable Long id, @RequestBody TournamentDto tournamentDto) { + var newTournament = tournamentMapper.toEntity(tournamentDto); + var tournament = tournamentService.updateTournament(id, newTournament); + + return ResponseEntity.ok(tournamentMapper.toDto(tournament)); + } + + @GetMapping("/tournaments/{id}/validate") + public ResponseEntity validateTournament(@PathVariable Long id) { + var tournament = tournamentService.findTournamentById(id); + + var tournamentValidation = tournamentValidationService.validate(tournament); + + return ResponseEntity.ok(tournamentValidationMapper.toDto(tournamentValidation)); + } + + @PostMapping("/tournaments/{id}/divide") + public ResponseEntity divideTournamentNew(@PathVariable Long id) { + var tournament = tournamentService.findTournamentById(id); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentDivideService.divide(tournament))); + } + + + @PostMapping("/tournaments/{id}/divide/clear") + public ResponseEntity clearTournamentDivision(@PathVariable Long id) { + var tournament = tournamentService.findTournamentById(id); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentDivideService.clear(tournament))); + } + + @PostMapping("/tournaments/{id}/draw") + public ResponseEntity drawTournament(@PathVariable Long id) { + var tournament = tournamentService.findTournamentById(id); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentDrawService.draw(tournament))); + } + + @PostMapping("/tournaments/{id}/draw/clear") + public ResponseEntity clearTournamentDraw(@PathVariable Long id) { + var tournament = tournamentService.findTournamentById(id); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentDrawService.clear(tournament))); + } + + @PostMapping("/tournaments/{tournamentId}/rounds/{roundId}/start") + public ResponseEntity startRound(@PathVariable Long tournamentId, @PathVariable Long roundId) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.startRound(tournament, roundId))); + } + + @PostMapping("/tournaments/{tournamentId}/rounds/{roundId}/finish") + public ResponseEntity finishRound(@PathVariable Long tournamentId, @PathVariable Long roundId) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.finishRound(tournament, roundId))); + } + + @PostMapping("/tournaments/{tournamentId}/groups/{groupId}/finish") + public ResponseEntity finishGroup(@PathVariable Long tournamentId, @PathVariable Long groupId) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.finishGroup(tournament, groupId))); + } + + @PostMapping("/tournaments/{tournamentId}/groups/{groupId}/new") + public ResponseEntity newRound(@PathVariable Long tournamentId, @PathVariable Long groupId) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.newRound(tournament, groupId))); + } + + @PostMapping("/tournaments/{tournamentId}/matches/{matchId}/start/{court}") + public ResponseEntity startMatch(@PathVariable Long tournamentId, @PathVariable Long matchId, @PathVariable Long court) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.startMatch(tournament, matchId, court))); + } + + @PostMapping("/tournaments/{tournamentId}/matches/{matchId}/stop") + public ResponseEntity stopMatch(@PathVariable Long tournamentId, @PathVariable Long matchId) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.stopMatch(tournament, matchId))); + } + + @PostMapping("/tournaments/{tournamentId}/matches/{matchId}") + public ResponseEntity saveResult(@PathVariable Long tournamentId, @PathVariable Long matchId, @RequestBody ResultDto resultDto) { + var tournament = tournamentService.findTournamentById(tournamentId); + + return ResponseEntity.ok(tournamentMapper.toDto(tournamentPlayService.saveResult(tournament, matchId, resultDto))); + } + + @PatchMapping("/tournaments/{tournamentId}/players/{playerId}/paid/{paid}") + public ResponseEntity updatePaid(@PathVariable Long tournamentId, @PathVariable Long playerId, @PathVariable Boolean paid) { + var tournament = tournamentService.findTournamentById(tournamentId); + + tournamentPlayService.updatePaid(tournament, playerId, paid); + + return ResponseEntity.noContent().build(); + } + + @PatchMapping("/tournaments/{tournamentId}/players/{playerId}/present/{present}") + public ResponseEntity updatePresent(@PathVariable Long tournamentId, @PathVariable Long playerId, @PathVariable Boolean present) { + var tournament = tournamentService.findTournamentById(tournamentId); + + tournamentPlayService.updatePresent(tournament, playerId, present); + + return ResponseEntity.noContent().build(); + } +} diff --git a/src/main/java/nl/connectedit/swiss/domain/EventDivision.java b/src/main/java/nl/connectedit/swiss/domain/EventDivision.java new file mode 100644 index 0000000..9dcbe52 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/EventDivision.java @@ -0,0 +1,15 @@ +package nl.connectedit.swiss.domain; + +import lombok.Data; +import nl.connectedit.swiss.domain.entity.Group; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class EventDivision { + + private Long eventId; + + private List groups = new ArrayList<>(); +} diff --git a/src/main/java/nl/connectedit/swiss/domain/EventType.java b/src/main/java/nl/connectedit/swiss/domain/EventType.java new file mode 100644 index 0000000..f2fbb68 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/EventType.java @@ -0,0 +1,20 @@ +package nl.connectedit.swiss.domain; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Getter +public enum EventType { + + HE("Herenenkel", false), + DE("Damesenkel", false), + HD("Herendubbel", true), + DD("Damesdubbel", true), + GD("Gemengd dubbel", true); + + private final String text; + + private final boolean isDoublesEvent; + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/EventValidation.java b/src/main/java/nl/connectedit/swiss/domain/EventValidation.java new file mode 100644 index 0000000..0f5aef8 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/EventValidation.java @@ -0,0 +1,16 @@ +package nl.connectedit.swiss.domain; + +import lombok.Builder; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +@Builder +public class EventValidation { + private Long eventId; + + @Builder.Default + private List validations = new ArrayList<>(); +} diff --git a/src/main/java/nl/connectedit/swiss/domain/PlayerStrength.java b/src/main/java/nl/connectedit/swiss/domain/PlayerStrength.java new file mode 100644 index 0000000..4a33438 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/PlayerStrength.java @@ -0,0 +1,17 @@ +package nl.connectedit.swiss.domain; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum PlayerStrength { + D5(8), + D6(6), + D7(4), + D8(3), + D9(2), + DR(1); + + private final int coefficient; +} diff --git a/src/main/java/nl/connectedit/swiss/domain/Sex.java b/src/main/java/nl/connectedit/swiss/domain/Sex.java new file mode 100644 index 0000000..c771636 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/Sex.java @@ -0,0 +1,10 @@ +package nl.connectedit.swiss.domain; + +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +public enum Sex { + +M, V + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/Status.java b/src/main/java/nl/connectedit/swiss/domain/Status.java new file mode 100644 index 0000000..e182951 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/Status.java @@ -0,0 +1,8 @@ +package nl.connectedit.swiss.domain; + +public enum Status { + NOT_STARTED, + READY_TO_PLAY, + IN_PROGRESS, + FINISHED +} diff --git a/src/main/java/nl/connectedit/swiss/domain/TournamentDivision.java b/src/main/java/nl/connectedit/swiss/domain/TournamentDivision.java new file mode 100644 index 0000000..7bd6e0c --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/TournamentDivision.java @@ -0,0 +1,17 @@ +package nl.connectedit.swiss.domain; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class TournamentDivision { + + private Long tournamentId; + + private boolean divided; + + private List eventDivisions = new ArrayList<>(); + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/TournamentStatus.java b/src/main/java/nl/connectedit/swiss/domain/TournamentStatus.java new file mode 100644 index 0000000..72869e0 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/TournamentStatus.java @@ -0,0 +1,17 @@ +package nl.connectedit.swiss.domain; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum TournamentStatus { + UPCOMING("Nieuw"), + DIVIDED("Ingedeeld"), + DRAWN("Geloot"), + ONGOING("Bezig"), + CLOSED("Gesloten"); + + private final String text; + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/TournamentValidation.java b/src/main/java/nl/connectedit/swiss/domain/TournamentValidation.java new file mode 100644 index 0000000..61703a9 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/TournamentValidation.java @@ -0,0 +1,20 @@ +package nl.connectedit.swiss.domain; + +import lombok.Data; + +import java.util.List; + +@Data +public class TournamentValidation { + + private Long tournamentId; + + private List validations; + + private List eventValidations; + + public boolean hasErrors() { + return !validations.isEmpty(); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/Validation.java b/src/main/java/nl/connectedit/swiss/domain/Validation.java new file mode 100644 index 0000000..e62af27 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/Validation.java @@ -0,0 +1,19 @@ +package nl.connectedit.swiss.domain; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.AllArgsConstructor; +import lombok.Data; + +@Data +@AllArgsConstructor +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Validation { + public enum Severity { + INFO, WARN, ERROR + } + private Severity severity; + + private String message; +} + + diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/AbstractEntity.java b/src/main/java/nl/connectedit/swiss/domain/entity/AbstractEntity.java new file mode 100644 index 0000000..7a083d1 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/AbstractEntity.java @@ -0,0 +1,27 @@ +package nl.connectedit.swiss.domain.entity; + +import org.hibernate.proxy.HibernateProxy; + +import java.util.Objects; + +public abstract class AbstractEntity { + + protected abstract Long getId(); + + @Override + public final boolean equals(Object o) { + if (this == o) return true; + if (o == null) return false; + Class oEffectiveClass = o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass(); + Class thisEffectiveClass = this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass() : this.getClass(); + if (thisEffectiveClass != oEffectiveClass) return false; + AbstractEntity abstractEntity = (AbstractEntity) o; + return getId() != null && Objects.equals(getId(), abstractEntity.getId()); + } + + @Override + public final int hashCode() { + return this instanceof HibernateProxy ? ((HibernateProxy) this).getHibernateLazyInitializer().getPersistentClass().hashCode() : getClass().hashCode(); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Event.java b/src/main/java/nl/connectedit/swiss/domain/entity/Event.java new file mode 100644 index 0000000..1f3ee24 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Event.java @@ -0,0 +1,62 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.*; +import nl.connectedit.swiss.domain.EventType; +import nl.connectedit.swiss.domain.Status; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@Entity +@Table +@Getter +@Setter +@RequiredArgsConstructor +@Builder +@AllArgsConstructor +public class Event extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + private Tournament tournament; + + @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY) +// @Builder.Default + private List registrations;// = new ArrayList<>(); + + @Enumerated(EnumType.STRING) + private Status status; + + @Enumerated(EnumType.STRING) + private EventType type; + + @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY) + private List groups;// = new ArrayList<>(); + + public static List getBlankEventSet(Tournament tournament) { + return Arrays.stream(EventType.values()) + .map(type -> Event + .builder() + .type(type) + .status(Status.NOT_STARTED) + .tournament(tournament) + .build() + ) + .collect(Collectors.toCollection(ArrayList::new)); + } + + public void addRegistration(Registration registration) { + this.registrations.add(registration); + } + + @Override + public String toString() { + return this.getType().getText(); + } +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Game.java b/src/main/java/nl/connectedit/swiss/domain/entity/Game.java new file mode 100644 index 0000000..129b9fc --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Game.java @@ -0,0 +1,26 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.*; + +@Entity +@Table +@Getter +@Setter +@Builder +@RequiredArgsConstructor +@AllArgsConstructor +public class Game extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + private Match match; + + private Long score1; + + private Long score2; + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Group.java b/src/main/java/nl/connectedit/swiss/domain/entity/Group.java new file mode 100644 index 0000000..36b7e13 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Group.java @@ -0,0 +1,38 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; +import nl.connectedit.swiss.domain.EventType; + +import java.util.ArrayList; +import java.util.List; +import nl.connectedit.swiss.domain.Status; + +@Entity +@Table(name = "eventgroup") +@Getter +@Setter +public class Group extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String name; + + @ManyToOne + private Event event; + + @Enumerated(EnumType.STRING) + private Status status; + + private EventType type; + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List rounds;// = new ArrayList<>(); + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List teams;// = new ArrayList<>(); + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Match.java b/src/main/java/nl/connectedit/swiss/domain/entity/Match.java new file mode 100644 index 0000000..13dac9a --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Match.java @@ -0,0 +1,49 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import nl.connectedit.swiss.domain.EventType; +import nl.connectedit.swiss.domain.Status; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table +@Getter +@Setter +@RequiredArgsConstructor +public class Match extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private EventType type; + + private Status status; + + @ManyToOne + private Round round; + + @ManyToOne + private Team team1; + + @ManyToOne + private Team team2; + + private Boolean played; + + private Long court; + + @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY) + private List games;// = new ArrayList<>(); + + private LocalDateTime startTime; + + private LocalDateTime endTime; + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Player.java b/src/main/java/nl/connectedit/swiss/domain/entity/Player.java new file mode 100644 index 0000000..4c2fca9 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Player.java @@ -0,0 +1,77 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import jakarta.validation.constraints.NotEmpty; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import nl.connectedit.swiss.domain.PlayerStrength; +import nl.connectedit.swiss.domain.Sex; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.List; + +import static org.springframework.util.StringUtils.hasLength; + +@Entity +@Table +@Getter +@Setter +@NoArgsConstructor +public class Player extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @Column(nullable = false) + @NotEmpty + private String firstName; + + @Column + private String middleName; + + @Column(nullable = false) + @NotEmpty + private String lastName; + + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private Sex sex; + + @Column(nullable = false) + @DateTimeFormat(pattern = "dd-MM-yyyy") + private LocalDate birthday; + + @Column(nullable = false) + private String phoneNumber; + + @Column(nullable = false) + private String email; + + @Column + private String club; + + @Column(nullable = false) + @Enumerated(EnumType.STRING) + private PlayerStrength strength; + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List registrations;// = new ArrayList<>(); + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List partnerRegistrations;// = new ArrayList<>(); + + public String getFullName() { + return hasLength(middleName) ? + String.join(" ", firstName, middleName, lastName) : + String.join(" ", firstName, lastName); + } + + @Override + public String toString() { + return this.getFullName(); + } +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Registration.java b/src/main/java/nl/connectedit/swiss/domain/entity/Registration.java new file mode 100644 index 0000000..9309895 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Registration.java @@ -0,0 +1,35 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.annotation.Nullable; +import jakarta.persistence.*; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + +@Entity +@Table +@Getter +@Setter +@RequiredArgsConstructor +public class Registration extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + private Event event; + + @ManyToOne + private Tournament tournament; + + @ManyToOne + @JoinColumn(name = "player_id") + private Player player; + + @Nullable + @ManyToOne + @JoinColumn(name = "partner_id") + private Player partner; + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Round.java b/src/main/java/nl/connectedit/swiss/domain/entity/Round.java new file mode 100644 index 0000000..d6e5d55 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Round.java @@ -0,0 +1,39 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; +import nl.connectedit.swiss.domain.Status; + +import java.util.ArrayList; +import java.util.List; + +@Entity +@Table +@Getter +@Setter +@RequiredArgsConstructor +public class Round extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String name; + + @ManyToOne + private Group group; + + private Status status; + + @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY) + private List matches;// = new ArrayList<>(); + + @OneToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY) + private List quit;// = new ArrayList<>(); + + @ManyToOne + private Team drawnOut; + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Team.java b/src/main/java/nl/connectedit/swiss/domain/entity/Team.java new file mode 100644 index 0000000..dbeb28b --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Team.java @@ -0,0 +1,34 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.annotation.Nullable; +import jakarta.persistence.*; +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import lombok.Setter; + +@Entity +@Table +@Getter +@Setter +@RequiredArgsConstructor +public class Team extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + private Group group; + + @ManyToOne + private Player player1; + + @Nullable + @ManyToOne + private Player player2; + + @Override + public String toString() { + return player2 != null ? player1.toString() + " + " + player2.toString() : player1.toString(); + } +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/Tournament.java b/src/main/java/nl/connectedit/swiss/domain/entity/Tournament.java new file mode 100644 index 0000000..b2caf41 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/Tournament.java @@ -0,0 +1,71 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; +import nl.connectedit.swiss.domain.EventType; +import nl.connectedit.swiss.domain.TournamentStatus; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +@Entity +@Table +@Getter +@Setter +public class Tournament extends AbstractEntity { + + public Tournament() { + initialize(); + } + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + private String name; + + private LocalDate date; + + @Enumerated(EnumType.STRING) + private TournamentStatus status; + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List events;// = new ArrayList<>(); + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + private List tournamentPlayers; + + private Long maxEvents; + + @ElementCollection + private List costsPerEvent; + + private Long courts; + + public void initialize() { + this.events = new ArrayList<>(); + this.events.addAll(Event.getBlankEventSet(this)); + this.status = TournamentStatus.UPCOMING; + } + + public Event getEventByType(EventType type) { + return events + .stream() + .filter(event -> event.getType().equals(type)) + .findFirst() + .orElse(null); + } + + public List getRegistrations() { + return events + .stream() + .map(Event::getRegistrations) + .flatMap(List::stream) + .collect(Collectors.toCollection(ArrayList::new)); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/domain/entity/TournamentPlayer.java b/src/main/java/nl/connectedit/swiss/domain/entity/TournamentPlayer.java new file mode 100644 index 0000000..4465734 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/domain/entity/TournamentPlayer.java @@ -0,0 +1,31 @@ +package nl.connectedit.swiss.domain.entity; + +import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Entity +@Table +@Getter +@Setter +public class TournamentPlayer extends AbstractEntity { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Long id; + + @ManyToOne + private Tournament tournament; + + @ElementCollection + private List events; + + @ManyToOne + private Player player; + + private boolean paid; + + private boolean present; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/AbstractDto.java b/src/main/java/nl/connectedit/swiss/dto/AbstractDto.java new file mode 100644 index 0000000..6c838e1 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/AbstractDto.java @@ -0,0 +1,4 @@ +package nl.connectedit.swiss.dto; + +public class AbstractDto { +} diff --git a/src/main/java/nl/connectedit/swiss/dto/EventDto.java b/src/main/java/nl/connectedit/swiss/dto/EventDto.java new file mode 100644 index 0000000..ec28c45 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/EventDto.java @@ -0,0 +1,22 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class EventDto extends AbstractDto { + private Long id; + + private String type; + + private String status; + + private boolean isDoublesEvent; + + private List registrations; + + private List groups; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/EventRegistrationDto.java b/src/main/java/nl/connectedit/swiss/dto/EventRegistrationDto.java new file mode 100644 index 0000000..ca4ae93 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/EventRegistrationDto.java @@ -0,0 +1,20 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class EventRegistrationDto extends AbstractDto { + private Long id; + + private String type; + + private boolean isDoublesEvent; + + private boolean registered; + + private Long player; + + private Long partner; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/EventValidationDto.java b/src/main/java/nl/connectedit/swiss/dto/EventValidationDto.java new file mode 100644 index 0000000..7859372 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/EventValidationDto.java @@ -0,0 +1,13 @@ +package nl.connectedit.swiss.dto; + +import lombok.Data; + +import java.util.List; + +@Data +public class EventValidationDto { + + private Long eventId; + + private List validations; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/GameDto.java b/src/main/java/nl/connectedit/swiss/dto/GameDto.java new file mode 100644 index 0000000..1a9cd05 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/GameDto.java @@ -0,0 +1,13 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class GameDto extends AbstractDto { + + private Long score1; + + private Long score2; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/GroupDto.java b/src/main/java/nl/connectedit/swiss/dto/GroupDto.java new file mode 100644 index 0000000..0082583 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/GroupDto.java @@ -0,0 +1,26 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class GroupDto extends AbstractDto { + + private Long id; + + private String name; + + private String type; + + private String status; + + private List teams; + + private List rounds; + + private StandingsDto standings; + +} diff --git a/src/main/java/nl/connectedit/swiss/dto/MatchDto.java b/src/main/java/nl/connectedit/swiss/dto/MatchDto.java new file mode 100644 index 0000000..5f8dc61 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/MatchDto.java @@ -0,0 +1,32 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.List; + +@Getter +@Setter +public class MatchDto extends AbstractDto { + + private Long id; + + private String type; + + private String status; + + private TeamDto team1; + + private TeamDto team2; + + private Boolean played; + + private List games; + + private LocalDateTime startTime; + + private LocalDateTime endTime; + + private Long court; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/PlayerDto.java b/src/main/java/nl/connectedit/swiss/dto/PlayerDto.java new file mode 100644 index 0000000..8249240 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/PlayerDto.java @@ -0,0 +1,34 @@ +package nl.connectedit.swiss.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +@Getter +@Setter +public class PlayerDto extends AbstractDto { + + private Long id; + + private String firstName; + + private String middleName; + + private String lastName; + + private String sex; + + @DateTimeFormat(pattern = "dd-MM-yyyy") + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + private String birthday; + + private String phoneNumber; + + private String email; + + private String club; + + private String strength; + +} diff --git a/src/main/java/nl/connectedit/swiss/dto/RegistrationDto.java b/src/main/java/nl/connectedit/swiss/dto/RegistrationDto.java new file mode 100644 index 0000000..cb06ec0 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/RegistrationDto.java @@ -0,0 +1,15 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class RegistrationDto extends AbstractDto { + private Long id; + + private PlayerDto player; + + private PlayerDto partner; +} + diff --git a/src/main/java/nl/connectedit/swiss/dto/ResultDto.java b/src/main/java/nl/connectedit/swiss/dto/ResultDto.java new file mode 100644 index 0000000..d1027c6 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/ResultDto.java @@ -0,0 +1,15 @@ +package nl.connectedit.swiss.dto; + +import java.util.ArrayList; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ResultDto extends AbstractDto { + + private Long matchId; + + private List games = new ArrayList<>(); +} diff --git a/src/main/java/nl/connectedit/swiss/dto/RoundDto.java b/src/main/java/nl/connectedit/swiss/dto/RoundDto.java new file mode 100644 index 0000000..85b0cba --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/RoundDto.java @@ -0,0 +1,26 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class RoundDto extends AbstractDto { + + private Long id; + + private String name; + + private List matches; + + private String status; + + private List quit; + + private TeamDto drawnOut; + + private StandingsDto standings; + +} diff --git a/src/main/java/nl/connectedit/swiss/dto/StandingsDto.java b/src/main/java/nl/connectedit/swiss/dto/StandingsDto.java new file mode 100644 index 0000000..4aa6162 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/StandingsDto.java @@ -0,0 +1,13 @@ +package nl.connectedit.swiss.dto; + +import java.util.ArrayList; +import java.util.List; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class StandingsDto { + + private List entries = new ArrayList<>(); +} diff --git a/src/main/java/nl/connectedit/swiss/dto/StandingsEntry.java b/src/main/java/nl/connectedit/swiss/dto/StandingsEntry.java new file mode 100644 index 0000000..7b87537 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/StandingsEntry.java @@ -0,0 +1,69 @@ +package nl.connectedit.swiss.dto; + +import java.util.Comparator; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import nl.connectedit.swiss.domain.entity.Team; + +@Getter +@Setter +@ToString +public class StandingsEntry { + + public StandingsEntry(Team team) { + this.team = team; + } + + private Long position; + + private Team team; + + private Long played = 0L; + + private Long won = 0L; + + private Long lost = 0L; + + private Long points = 0L; + + private Long gamesWon = 0L; + + private Long gamesLost = 0L; + + private Long pointsWon = 0L; + + private Long pointsLost = 0L; + + public static int compare(StandingsEntry s1, StandingsEntry s2) { + var pointsPerMatchS1 = safeDivide(s1.points, s1.played); + var pointsPerMatchS2 = safeDivide(s2.points, s2.played); + if (pointsPerMatchS1 > pointsPerMatchS2) { + return -1; + } else if (pointsPerMatchS1 < pointsPerMatchS2) { + return 1; + } else { + if (s1.played < s2.played) { + return -1; + } else if (s1.played > s2.played) { + return 1; + } else { + var gamesPerMatchS1 = safeDivide(s1.gamesWon - s1.gamesLost, s1.played); + var gamesPerMatchS2 = safeDivide(s2.gamesWon - s2.gamesLost, s2.played); + if (gamesPerMatchS1 > gamesPerMatchS2) { + return -1; + } else if (gamesPerMatchS1 < gamesPerMatchS2) { + return 1; + } else { + var ptsPerMatchS1 = safeDivide(s1.pointsWon - s1.pointsLost, s1.played); + var ptsPerMatchS2 = safeDivide(s2.pointsWon - s2.pointsLost, s2.played); + return Double.compare(ptsPerMatchS2, ptsPerMatchS1); + } + } + } + } + + private static double safeDivide(Long a, Long b) { + return (a == 0 && b == 0) ? 0 : (double) a / b; + } +} diff --git a/src/main/java/nl/connectedit/swiss/dto/StandingsEntryDto.java b/src/main/java/nl/connectedit/swiss/dto/StandingsEntryDto.java new file mode 100644 index 0000000..c16aaa4 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/StandingsEntryDto.java @@ -0,0 +1,30 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class StandingsEntryDto { + + private Long position; + + private TeamDto team; + + private Long played; + + private Long won; + + private Long lost; + + private Long points; + + private Long gamesWon; + + private Long gamesLost; + + private Long pointsWon; + + private Long pointsLost; + +} diff --git a/src/main/java/nl/connectedit/swiss/dto/TeamDto.java b/src/main/java/nl/connectedit/swiss/dto/TeamDto.java new file mode 100644 index 0000000..ce89ca8 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/TeamDto.java @@ -0,0 +1,13 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class TeamDto extends AbstractDto { + + private PlayerDto player1; + + private PlayerDto player2; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/TournamentDto.java b/src/main/java/nl/connectedit/swiss/dto/TournamentDto.java new file mode 100644 index 0000000..f7dcc96 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/TournamentDto.java @@ -0,0 +1,32 @@ +package nl.connectedit.swiss.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class TournamentDto extends AbstractDto { + + private Long id; + + private String name; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + private String date; + + private String status; + + private List events; + + private List tournamentPlayers; + + private Long maxEvents; + + private List costsPerEvent; + + private Long courts; + +} diff --git a/src/main/java/nl/connectedit/swiss/dto/TournamentPlayerDto.java b/src/main/java/nl/connectedit/swiss/dto/TournamentPlayerDto.java new file mode 100644 index 0000000..c81f70b --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/TournamentPlayerDto.java @@ -0,0 +1,23 @@ +package nl.connectedit.swiss.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class TournamentPlayerDto extends AbstractDto { + + private Long playerId; + + private String name; + + private List events; + + private Boolean paid; + + private Boolean present; + +} diff --git a/src/main/java/nl/connectedit/swiss/dto/TournamentRegistrationDto.java b/src/main/java/nl/connectedit/swiss/dto/TournamentRegistrationDto.java new file mode 100644 index 0000000..9d32fc3 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/TournamentRegistrationDto.java @@ -0,0 +1,25 @@ +package nl.connectedit.swiss.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class TournamentRegistrationDto extends AbstractDto { + + private Long id; + + private String name; + + private Boolean editable; + + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "dd-MM-yyyy") + private String date; + + private String status; + + private List events; +} diff --git a/src/main/java/nl/connectedit/swiss/dto/TournamentValidationDto.java b/src/main/java/nl/connectedit/swiss/dto/TournamentValidationDto.java new file mode 100644 index 0000000..38d8887 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/TournamentValidationDto.java @@ -0,0 +1,19 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; +import nl.connectedit.swiss.domain.Validation; + +import java.util.List; + +@Getter +@Setter +public class TournamentValidationDto extends AbstractDto { + + private Long id; + + private List validations; + + private List eventValidations; +} + diff --git a/src/main/java/nl/connectedit/swiss/dto/ValidationDto.java b/src/main/java/nl/connectedit/swiss/dto/ValidationDto.java new file mode 100644 index 0000000..4431df6 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/dto/ValidationDto.java @@ -0,0 +1,11 @@ +package nl.connectedit.swiss.dto; + +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class ValidationDto extends AbstractDto { + private String severity; + private String message; +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/DtoMapper.java b/src/main/java/nl/connectedit/swiss/mapper/DtoMapper.java new file mode 100644 index 0000000..a9d84be --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/DtoMapper.java @@ -0,0 +1,8 @@ +package nl.connectedit.swiss.mapper; + +import nl.connectedit.swiss.domain.entity.AbstractEntity; +import nl.connectedit.swiss.dto.AbstractDto; + +public interface DtoMapper { + D toDto(E entity); +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/EntityMapper.java b/src/main/java/nl/connectedit/swiss/mapper/EntityMapper.java new file mode 100644 index 0000000..9915219 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/EntityMapper.java @@ -0,0 +1,8 @@ +package nl.connectedit.swiss.mapper; + +import nl.connectedit.swiss.domain.entity.AbstractEntity; +import nl.connectedit.swiss.dto.AbstractDto; + +public interface EntityMapper { + E toEntity(D dto); +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/EventMapper.java b/src/main/java/nl/connectedit/swiss/mapper/EventMapper.java new file mode 100644 index 0000000..3a573b0 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/EventMapper.java @@ -0,0 +1,66 @@ +package nl.connectedit.swiss.mapper; + +import java.util.Arrays; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.Status; +import nl.connectedit.swiss.domain.entity.Event; +import nl.connectedit.swiss.domain.EventType; +import nl.connectedit.swiss.dto.EventDto; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class EventMapper implements DtoMapper, EntityMapper { + + private final RegistrationMapper registrationMapper; + + private final GroupMapper groupMapper; + + @Override + public Event toEntity(EventDto eventDto) { + Event event = new Event(); + event.setId(eventDto.getId()); + event.setType( + Arrays.stream(EventType.values()) + .filter(ts -> ts.getText().equals(eventDto.getType())) + .findFirst() + .orElse(null) + ); + event.setStatus(Status.valueOf(eventDto.getStatus())); + event.setRegistrations( + eventDto.getRegistrations() + .stream() + .map(registrationMapper::toEntity) + .toList() + ); + + return event; + } + + @Override + public EventDto toDto(Event event) { + EventDto eventDto = new EventDto(); + eventDto.setId(event.getId()); + eventDto.setType(event.getType().name()); + eventDto.setStatus(event.getStatus().name()); + eventDto.setDoublesEvent(event.getType().isDoublesEvent()); + if (event.getRegistrations() != null) { + eventDto.setRegistrations( + event.getRegistrations() + .stream() + .map(registrationMapper::toDto) + .toList() + ); + } + if (event.getGroups() != null) { + eventDto.setGroups( + event.getGroups() + .stream() + .map(groupMapper::toDto) + .toList() + ); + } + + return eventDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/GameMapper.java b/src/main/java/nl/connectedit/swiss/mapper/GameMapper.java new file mode 100644 index 0000000..11e6c1d --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/GameMapper.java @@ -0,0 +1,18 @@ +package nl.connectedit.swiss.mapper; + +import nl.connectedit.swiss.domain.entity.Game; +import nl.connectedit.swiss.dto.GameDto; +import org.springframework.stereotype.Component; + +@Component +public class GameMapper implements DtoMapper { + + @Override + public GameDto toDto(Game game) { + var gameDto = new GameDto(); + gameDto.setScore1(game.getScore1()); + gameDto.setScore2(game.getScore2()); + + return gameDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/GroupMapper.java b/src/main/java/nl/connectedit/swiss/mapper/GroupMapper.java new file mode 100644 index 0000000..349fb30 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/GroupMapper.java @@ -0,0 +1,55 @@ +package nl.connectedit.swiss.mapper; + +import java.util.ArrayList; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.Status; +import nl.connectedit.swiss.domain.entity.Group; +import nl.connectedit.swiss.domain.entity.Round; +import nl.connectedit.swiss.dto.GroupDto; +import nl.connectedit.swiss.dto.RoundDto; +import nl.connectedit.swiss.service.StandingsService; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class GroupMapper implements DtoMapper { + + private final TeamMapper teamMapper; + + private final RoundMapper roundMapper; + + private final StandingsService standingsService; + + private final StandingsMapper standingsMapper; + + @Override + public GroupDto toDto(Group group) { + var groupDto = new GroupDto(); + groupDto.setId(group.getId()); + groupDto.setName(group.getName()); + groupDto.setType(group.getType().name()); + groupDto.setStatus(group.getStatus().name()); + groupDto.setTeams( + group.getTeams() + .stream() + .map(teamMapper::toDto) + .toList()); + + var standingsGroup = new ArrayList(); + var rounds = new ArrayList(); + if (group.getRounds() != null) { + for (var round : group.getRounds()) { + if (round.getStatus() == Status.FINISHED) { + standingsGroup.add(round); + } + rounds.add(roundMapper.toDto(round, standingsGroup, group.getTeams())); + } + } + groupDto.setRounds(rounds); + + var standings = standingsService.getStandings(group.getRounds(), group.getTeams()); + groupDto.setStandings(standingsMapper.toDto(standings)); + + return groupDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/MatchMapper.java b/src/main/java/nl/connectedit/swiss/mapper/MatchMapper.java new file mode 100644 index 0000000..aad9617 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/MatchMapper.java @@ -0,0 +1,39 @@ +package nl.connectedit.swiss.mapper; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Match; +import nl.connectedit.swiss.dto.MatchDto; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class MatchMapper implements DtoMapper { + + private final TeamMapper teamMapper; + + private final GameMapper gameMapper; + + @Override + public MatchDto toDto(Match match) { + var matchDto = new MatchDto(); + + matchDto.setId(match.getId()); + matchDto.setType(match.getType().name()); + matchDto.setStatus(match.getStatus().name()); + matchDto.setTeam1(teamMapper.toDto(match.getTeam1())); + matchDto.setTeam2(teamMapper.toDto(match.getTeam2())); + matchDto.setStartTime(match.getStartTime()); + matchDto.setEndTime(match.getEndTime()); + matchDto.setCourt(match.getCourt()); + + if (match.getGames() != null) { + matchDto.setGames( + match.getGames() + .stream() + .map(gameMapper::toDto) + .toList()); + } + + return matchDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/PlayerMapper.java b/src/main/java/nl/connectedit/swiss/mapper/PlayerMapper.java new file mode 100644 index 0000000..d49964a --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/PlayerMapper.java @@ -0,0 +1,57 @@ +package nl.connectedit.swiss.mapper; + +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.domain.PlayerStrength; +import nl.connectedit.swiss.domain.Sex; +import nl.connectedit.swiss.dto.PlayerDto; +import org.springframework.stereotype.Component; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.Objects; + +@Component +public class PlayerMapper implements DtoMapper, EntityMapper { + + @Override + public Player toEntity(PlayerDto playerDto) { + Objects.requireNonNull(playerDto.getFirstName(), "Voornaam is verplicht"); + Objects.requireNonNull(playerDto.getLastName(), "Achternaam is verplicht"); + Objects.requireNonNull(playerDto.getSex(), "Geslacht is verplicht"); + Objects.requireNonNull(playerDto.getPhoneNumber(), "Telefoon is verplicht"); + Objects.requireNonNull(playerDto.getEmail(), "Emailadres is verplicht"); + Objects.requireNonNull(playerDto.getBirthday(), "Geboortedatum is verplicht"); + Objects.requireNonNull(playerDto.getStrength(), "Speelsterkte is verplicht"); + + Player player = new Player(); + player.setId(playerDto.getId()); + player.setFirstName(playerDto.getFirstName()); + player.setMiddleName(playerDto.getMiddleName()); + player.setLastName(playerDto.getLastName()); + player.setSex(Sex.valueOf(playerDto.getSex())); + player.setBirthday(LocalDate.parse(playerDto.getBirthday(), DateTimeFormatter.ofPattern("dd-MM-yyyy"))); + player.setPhoneNumber(playerDto.getPhoneNumber()); + player.setEmail(playerDto.getEmail()); + player.setClub(playerDto.getClub()); + player.setStrength(PlayerStrength.valueOf(playerDto.getStrength())); + + return player; + } + + @Override + public PlayerDto toDto(Player player) { + PlayerDto playerDto = new PlayerDto(); + playerDto.setId(player.getId()); + playerDto.setFirstName(player.getFirstName()); + playerDto.setMiddleName(player.getMiddleName()); + playerDto.setLastName(player.getLastName()); + playerDto.setSex(player.getSex().name()); + playerDto.setBirthday(player.getBirthday().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))); + playerDto.setPhoneNumber(player.getPhoneNumber()); + playerDto.setEmail(player.getEmail()); + playerDto.setClub(player.getClub()); + playerDto.setStrength(player.getStrength().name()); + + return playerDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/RegistrationMapper.java b/src/main/java/nl/connectedit/swiss/mapper/RegistrationMapper.java new file mode 100644 index 0000000..1277fe0 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/RegistrationMapper.java @@ -0,0 +1,36 @@ +package nl.connectedit.swiss.mapper; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Registration; +import nl.connectedit.swiss.dto.RegistrationDto; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class RegistrationMapper implements DtoMapper, EntityMapper { + + private final PlayerMapper playerMapper; + + @Override + public Registration toEntity(RegistrationDto registrationDto) { + Registration registration = new Registration(); + registration.setId(registrationDto.getId()); + registration.setPlayer(playerMapper.toEntity(registrationDto.getPlayer())); + if (registrationDto.getPartner() != null) { + registration.setPartner(playerMapper.toEntity(registrationDto.getPartner())); + } + return registration; + } + + @Override + public RegistrationDto toDto(Registration registration) { + RegistrationDto registrationDto = new RegistrationDto(); + registrationDto.setId(registration.getId()); +// registrationDto.setTournament(registration.getEvent().getTournament().getId()); + registrationDto.setPlayer(playerMapper.toDto(registration.getPlayer())); + if (registration.getPartner() != null) { + registrationDto.setPartner(playerMapper.toDto(registration.getPartner())); + } + return registrationDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/RoundMapper.java b/src/main/java/nl/connectedit/swiss/mapper/RoundMapper.java new file mode 100644 index 0000000..1519f47 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/RoundMapper.java @@ -0,0 +1,53 @@ +package nl.connectedit.swiss.mapper; + +import java.util.List; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Group; +import nl.connectedit.swiss.domain.entity.Round; +import nl.connectedit.swiss.domain.entity.Team; +import nl.connectedit.swiss.dto.RoundDto; +import nl.connectedit.swiss.service.StandingsService; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class RoundMapper { + + private final MatchMapper matchMapper; + + private final TeamMapper teamMapper; + + private final StandingsService standingsService; + + private final StandingsMapper standingsMapper; + + public RoundDto toDto(Round round, List roundsForStandings, List teamsForStandings) { + var roundDto = new RoundDto(); + roundDto.setId(round.getId()); + roundDto.setName(round.getName()); + roundDto.setMatches( + round.getMatches() + .stream() + .map(matchMapper::toDto) + .toList()); + roundDto.setStatus(round.getStatus().name()); + if (round.getQuit() != null) { + roundDto.setQuit( + round.getQuit() + .stream() + .map(teamMapper::toDto) + .toList()); + } + if (round.getDrawnOut() != null) { + roundDto.setDrawnOut(teamMapper.toDto(round.getDrawnOut())); + } + + var standings = standingsService.getStandings(roundsForStandings, teamsForStandings); + roundDto.setStandings(standingsMapper.toDto(standings)); + + return roundDto; + } + + + +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/StandingsMapper.java b/src/main/java/nl/connectedit/swiss/mapper/StandingsMapper.java new file mode 100644 index 0000000..7bf29f9 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/StandingsMapper.java @@ -0,0 +1,42 @@ +package nl.connectedit.swiss.mapper; + +import java.util.Iterator; +import java.util.List; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.dto.StandingsDto; +import nl.connectedit.swiss.dto.StandingsEntry; +import nl.connectedit.swiss.dto.StandingsEntryDto; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class StandingsMapper { + + private final TeamMapper teamMapper; + + public StandingsDto toDto(List standings) { + var standingsDto = new StandingsDto(); + Long position = 1L; + for (Iterator i = standings.iterator(); i.hasNext(); position++ ) { + standingsDto.getEntries().add(toDto(i.next(), position)); + } + + return standingsDto; + } + + private StandingsEntryDto toDto(StandingsEntry standingsEntry, Long position) { + var standingsEntryDto = new StandingsEntryDto(); + standingsEntryDto.setPosition(position); + standingsEntryDto.setTeam(teamMapper.toDto(standingsEntry.getTeam())); + standingsEntryDto.setPlayed(standingsEntry.getPlayed()); + standingsEntryDto.setWon(standingsEntry.getWon()); + standingsEntryDto.setLost(standingsEntry.getLost()); + standingsEntryDto.setPoints(standingsEntry.getPoints()); + standingsEntryDto.setGamesWon(standingsEntry.getGamesWon()); + standingsEntryDto.setGamesLost(standingsEntry.getGamesLost()); + standingsEntryDto.setPointsWon(standingsEntry.getPointsWon()); + standingsEntryDto.setPointsLost(standingsEntry.getPointsLost()); + + return standingsEntryDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/TeamMapper.java b/src/main/java/nl/connectedit/swiss/mapper/TeamMapper.java new file mode 100644 index 0000000..314a9bc --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/TeamMapper.java @@ -0,0 +1,25 @@ +package nl.connectedit.swiss.mapper; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Team; +import nl.connectedit.swiss.dto.TeamDto; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class TeamMapper implements DtoMapper { + + private final PlayerMapper playerMapper; + + @Override + public TeamDto toDto(Team team) { + var teamDto = new TeamDto(); + teamDto.setPlayer1(playerMapper.toDto(team.getPlayer1())); + + if (team.getPlayer2() != null) { + teamDto.setPlayer2(playerMapper.toDto(team.getPlayer2())); + } + + return teamDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/TournamentMapper.java b/src/main/java/nl/connectedit/swiss/mapper/TournamentMapper.java new file mode 100644 index 0000000..4027c65 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/TournamentMapper.java @@ -0,0 +1,81 @@ +package nl.connectedit.swiss.mapper; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.domain.entity.TournamentPlayer; +import nl.connectedit.swiss.dto.TournamentDto; +import nl.connectedit.swiss.dto.TournamentPlayerDto; +import org.springframework.stereotype.Component; + +@Component +@RequiredArgsConstructor +public class TournamentMapper implements DtoMapper, EntityMapper { + + private final EventMapper eventMapper; + + private final TournamentPlayerMapper tournamentPlayerMapper; + + @Override + public Tournament toEntity(TournamentDto tournamentDto) { + Tournament tournament = new Tournament(); + tournament.setId(tournamentDto.getId()); + tournament.setName(tournamentDto.getName()); + tournament.setDate(LocalDate.parse(tournamentDto.getDate(), DateTimeFormatter.ofPattern("dd-MM-yyyy"))); + tournament.setStatus( + Arrays.stream(TournamentStatus.values()) + .filter(ts -> ts.getText().equals(tournamentDto.getStatus())) + .findFirst() + .orElse(TournamentStatus.UPCOMING) + ); + tournament.setMaxEvents(tournamentDto.getMaxEvents()); + tournament.setCostsPerEvent(tournamentDto.getCostsPerEvent()); + tournament.setCourts(tournamentDto.getCourts()); + + return tournament; + } + + @Override + public TournamentDto toDto(Tournament tournament) { + TournamentDto tournamentDto = new TournamentDto(); + tournamentDto.setId(tournament.getId()); + tournamentDto.setName(tournament.getName()); + tournamentDto.setDate(tournament.getDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))); + tournamentDto.setStatus(tournament.getStatus().name()); + tournamentDto.setEvents( + tournament.getEvents() + .stream() + .map(eventMapper::toDto) + .toList() + ); + + if (tournament.getTournamentPlayers() != null) { + var tournamentPlayers = tournament.getTournamentPlayers(); + + tournamentPlayers.sort(Comparator.comparing((TournamentPlayer tournamentPlayer) -> tournamentPlayer.getPlayer().getLastName()) + .thenComparing((TournamentPlayer tournamentPlayer) -> tournamentPlayer.getPlayer().getFirstName())); + + tournamentDto.setTournamentPlayers(tournamentPlayers + .stream() + .map(tournamentPlayerMapper::toDto) + .toList() + ); + } + + tournamentDto.setMaxEvents(tournament.getMaxEvents() == null ? 2L : tournament.getMaxEvents()); + + if (tournament.getCostsPerEvent() == null || tournament.getCostsPerEvent().isEmpty()) { + tournamentDto.setCostsPerEvent(List.of(0f, 0f, 0f)); + } else { + tournamentDto.setCostsPerEvent(tournament.getCostsPerEvent()); + } + + tournamentDto.setCourts(tournament.getCourts() == null ? 1L : tournament.getCourts()); + + return tournamentDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerMapper.java b/src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerMapper.java new file mode 100644 index 0000000..5a28201 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerMapper.java @@ -0,0 +1,29 @@ +package nl.connectedit.swiss.mapper; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Team; +import nl.connectedit.swiss.domain.entity.TournamentPlayer; +import nl.connectedit.swiss.dto.TeamDto; +import nl.connectedit.swiss.dto.TournamentPlayerDto; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; + +@Component +@RequiredArgsConstructor +public class TournamentPlayerMapper implements DtoMapper { + + private final PlayerMapper playerMapper; + + @Override + public TournamentPlayerDto toDto(TournamentPlayer tournamentPlayer) { + var tournamentPlayerDto = new TournamentPlayerDto(); + tournamentPlayerDto.setPlayerId(tournamentPlayer.getPlayer().getId()); + tournamentPlayerDto.setName(tournamentPlayer.getPlayer().getFullName()); + tournamentPlayerDto.setEvents(new ArrayList<>(tournamentPlayer.getEvents())); + tournamentPlayerDto.setPaid(tournamentPlayer.isPaid()); + tournamentPlayerDto.setPresent(tournamentPlayer.isPresent()); + + return tournamentPlayerDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerRegistrationMapper.java b/src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerRegistrationMapper.java new file mode 100644 index 0000000..3cef07f --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/TournamentPlayerRegistrationMapper.java @@ -0,0 +1,78 @@ +package nl.connectedit.swiss.mapper; + +import java.time.format.DateTimeFormatter; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.domain.entity.Event; +import nl.connectedit.swiss.domain.EventType; +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.domain.Sex; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.dto.EventRegistrationDto; +import nl.connectedit.swiss.dto.TournamentRegistrationDto; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@RequiredArgsConstructor +public class TournamentPlayerRegistrationMapper { + + public List mapToDto(List tournaments, Player player) { + return tournaments.stream() + .map(tournament -> this.mapToTournamentRegistrationDto(tournament, player)) + .toList(); + } + + public TournamentRegistrationDto mapToTournamentRegistrationDto(Tournament tournament, Player player) { + TournamentRegistrationDto tournamentRegistrationDto = new TournamentRegistrationDto(); + tournamentRegistrationDto.setId(tournament.getId()); + tournamentRegistrationDto.setName(tournament.getName()); + tournamentRegistrationDto.setEditable(tournament.getStatus() == TournamentStatus.UPCOMING); + tournamentRegistrationDto.setDate(tournament.getDate().format(DateTimeFormatter.ofPattern("dd-MM-yyyy"))); + tournamentRegistrationDto.setStatus(tournament.getStatus().name()); + tournamentRegistrationDto.setEvents( + tournament.getEvents() + .stream() + .filter(event -> isRelevant(event, player)) + .map(event -> this.mapToEventRegistrationDto(event, player)) + .toList() + ); + + return tournamentRegistrationDto; + } + + private boolean isRelevant(Event event, Player player) { + if (player.getSex() == Sex.M) { + return switch(event.getType()) { + case EventType.HE, EventType.HD, EventType.GD -> true; + default -> false; + }; + } else { + return switch(event.getType()) { + case EventType.DE, EventType.DD, EventType.GD -> true; + default -> false; + }; + } + } + + private EventRegistrationDto mapToEventRegistrationDto(Event event, Player player) { + EventRegistrationDto eventRegistrationDto = new EventRegistrationDto(); + eventRegistrationDto.setId(event.getId()); + eventRegistrationDto.setType(event.getType().name()); + eventRegistrationDto.setDoublesEvent(event.getType().isDoublesEvent()); + for (var registration : event.getRegistrations()) { + if (registration.getPlayer().getId().equals(player.getId())) { + eventRegistrationDto.setRegistered(true); + eventRegistrationDto.setPlayer(registration.getPlayer().getId()); + if (registration.getPartner() != null) { + eventRegistrationDto.setPartner(registration.getPartner().getId()); + } + break; + } else { + eventRegistrationDto.setRegistered(false); + } + } + return eventRegistrationDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/mapper/TournamentValidationMapper.java b/src/main/java/nl/connectedit/swiss/mapper/TournamentValidationMapper.java new file mode 100644 index 0000000..a8f808c --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/mapper/TournamentValidationMapper.java @@ -0,0 +1,45 @@ +package nl.connectedit.swiss.mapper; + +import nl.connectedit.swiss.domain.Validation; +import nl.connectedit.swiss.domain.EventValidation; +import nl.connectedit.swiss.domain.TournamentValidation; +import nl.connectedit.swiss.dto.EventValidationDto; +import nl.connectedit.swiss.dto.TournamentValidationDto; +import nl.connectedit.swiss.dto.ValidationDto; +import org.springframework.stereotype.Component; + +@Component +public class TournamentValidationMapper { + + public TournamentValidationDto toDto(TournamentValidation tournamentValidation) { + var tournamentValidationDto = new TournamentValidationDto(); + tournamentValidationDto.setId(tournamentValidation.getTournamentId()); + tournamentValidationDto.setValidations(tournamentValidation.getValidations()); + tournamentValidationDto.setEventValidations( + tournamentValidation.getEventValidations() + .stream() + .map(this::toEventValidationDto) + .toList() + ); + return tournamentValidationDto; + } + + private EventValidationDto toEventValidationDto(EventValidation eventValidation) { + var eventValidationDto = new EventValidationDto(); + eventValidationDto.setEventId(eventValidation.getEventId()); + eventValidationDto.setValidations( + eventValidation.getValidations() + .stream() + .map(this::toValidationDto) + .toList() + ); + return eventValidationDto; + } + + private ValidationDto toValidationDto(Validation validation) { + var validationDto = new ValidationDto(); + validationDto.setSeverity(validation.getSeverity().name()); + validationDto.setMessage(validation.getMessage()); + return validationDto; + } +} diff --git a/src/main/java/nl/connectedit/swiss/repository/PlayerRepository.java b/src/main/java/nl/connectedit/swiss/repository/PlayerRepository.java new file mode 100644 index 0000000..5fe2f6a --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/repository/PlayerRepository.java @@ -0,0 +1,8 @@ +package nl.connectedit.swiss.repository; + +import nl.connectedit.swiss.domain.entity.Player; +import org.springframework.data.jpa.repository.JpaRepository; + +public interface PlayerRepository extends JpaRepository { + +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/repository/RegistrationRepository.java b/src/main/java/nl/connectedit/swiss/repository/RegistrationRepository.java new file mode 100644 index 0000000..5a94d9a --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/repository/RegistrationRepository.java @@ -0,0 +1,17 @@ +package nl.connectedit.swiss.repository; + +import nl.connectedit.swiss.domain.entity.Registration; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +public interface RegistrationRepository extends JpaRepository { + + @Query(""" + select r from Registration r + where r.player.id = :playerId + """) + List findRegistrationsForPlayer(@Param("playerId") Long playerId); +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/repository/TournamentRepository.java b/src/main/java/nl/connectedit/swiss/repository/TournamentRepository.java new file mode 100644 index 0000000..8ed0dc7 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/repository/TournamentRepository.java @@ -0,0 +1,12 @@ +package nl.connectedit.swiss.repository; + +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.domain.TournamentStatus; +import org.springframework.data.jpa.repository.JpaRepository; + +import java.util.List; + +public interface TournamentRepository extends JpaRepository { + + List findAllByStatus(TournamentStatus status); +} \ No newline at end of file diff --git a/src/main/java/nl/connectedit/swiss/service/PlayerService.java b/src/main/java/nl/connectedit/swiss/service/PlayerService.java new file mode 100644 index 0000000..babd866 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/PlayerService.java @@ -0,0 +1,29 @@ +package nl.connectedit.swiss.service; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.repository.PlayerRepository; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@RequiredArgsConstructor +public class PlayerService { + + private final PlayerRepository playerRepository; + + public Player savePlayer(Player player) { + return playerRepository.save(player); + } + + public List findAllPlayers() { + return playerRepository.findAll(); + } + + public Player findPlayerById(Long id) { + return playerRepository.getReferenceById(id); + } + + +} diff --git a/src/main/java/nl/connectedit/swiss/service/RegistrationService.java b/src/main/java/nl/connectedit/swiss/service/RegistrationService.java new file mode 100644 index 0000000..9041113 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/RegistrationService.java @@ -0,0 +1,53 @@ +package nl.connectedit.swiss.service; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.domain.entity.Registration; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.dto.EventRegistrationDto; +import nl.connectedit.swiss.repository.RegistrationRepository; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@RequiredArgsConstructor +public class RegistrationService { + + private final TournamentService tournamentService; + + private final PlayerService playerService; + + public void updateOrAddRegistrations(EventRegistrationDto eventRegistration, Tournament tournament, Player player) { + var event = tournament.getEvents().stream().filter(e -> e.getId().equals(eventRegistration.getId())).findFirst().orElseThrow(); + + if (!eventRegistration.isRegistered()) { // remove any existing registration + event.getRegistrations().removeIf(registration -> registration.getPlayer().equals(player)); + } else { + var optionalExistingPlayerRegistration = event.getRegistrations().stream() + .filter(registration -> registration.getPlayer().equals(player)) + .findAny(); + if (optionalExistingPlayerRegistration.isEmpty()) { // no previous registration for this event + var newRegistration = new Registration(); + newRegistration.setTournament(tournament); + newRegistration.setEvent(event); + newRegistration.setPlayer(player); + if (eventRegistration.getPartner() != null){ + var partner = playerService.findPlayerById(eventRegistration.getPartner()); + newRegistration.setPartner(partner); + } + event.addRegistration(newRegistration); + } else { // change existing registration + var existingPlayerRegistration = optionalExistingPlayerRegistration.get(); + if (eventRegistration.getPartner() != null){ + var partner = playerService.findPlayerById(eventRegistration.getPartner()); + existingPlayerRegistration.setPartner(partner); + } else { + existingPlayerRegistration.setPartner(null); + } + } + } + + tournamentService.saveTournament(tournament); + } +} diff --git a/src/main/java/nl/connectedit/swiss/service/ServiceUtil.java b/src/main/java/nl/connectedit/swiss/service/ServiceUtil.java new file mode 100644 index 0000000..ec57b1d --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/ServiceUtil.java @@ -0,0 +1,51 @@ +package nl.connectedit.swiss.service; + +import java.util.Collection; +import java.util.Objects; +import nl.connectedit.swiss.domain.entity.Event; +import nl.connectedit.swiss.domain.entity.Group; +import nl.connectedit.swiss.domain.entity.Match; +import nl.connectedit.swiss.domain.entity.Round; +import nl.connectedit.swiss.domain.entity.Tournament; +import org.springframework.stereotype.Component; + +@Component +public class ServiceUtil { + + static Group getGroup(Tournament tournament, Long groupId) { + return tournament.getEvents() + .stream() + .map(Event::getGroups) + .flatMap(Collection::stream) + .filter(group -> Objects.equals(group.getId(), groupId)) + .findAny() + .orElseThrow(); + } + + static Round getRound(Tournament tournament, Long roundId) { + return tournament.getEvents() + .stream() + .map(Event::getGroups) + .flatMap(Collection::stream) + .map(Group::getRounds) + .flatMap(Collection::stream) + .filter(round -> Objects.equals(round.getId(), roundId)) + .findAny() + .orElseThrow(); + } + + static Match getMatch(Tournament tournament, Long matchId) { + return tournament.getEvents() + .stream() + .map(Event::getGroups) + .flatMap(Collection::stream) + .map(Group::getRounds) + .flatMap(Collection::stream) + .map(Round::getMatches) + .flatMap(Collection::stream) + .filter(match -> Objects.equals(match.getId(), matchId)) + .findAny() + .orElseThrow(); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/service/StandingsService.java b/src/main/java/nl/connectedit/swiss/service/StandingsService.java new file mode 100644 index 0000000..44a2170 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/StandingsService.java @@ -0,0 +1,116 @@ +package nl.connectedit.swiss.service; + +import nl.connectedit.swiss.domain.entity.Group; +import nl.connectedit.swiss.domain.entity.Match; +import nl.connectedit.swiss.domain.entity.Round; +import nl.connectedit.swiss.domain.entity.Team; +import nl.connectedit.swiss.dto.StandingsEntry; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +@Service +public class StandingsService { + + public List getStandings(List rounds, List teams) { + var standings = new ArrayList(); + teams.forEach(team -> standings.add(new StandingsEntry(team))); + if (rounds != null) { + for (var round : rounds) { + addRoundToStandings(standings, round); + } + } + return sortStandings(standings); + } + + private void addRoundToStandings(List standings, Round round) { + var matches = round.getMatches(); + + for (var match : matches) { + addMatchToStandingsEntry(standings, match); + } + } + + private void addMatchToStandingsEntry(List standings, Match match) { + if (!match.getPlayed()) return; + + var standingTeam1 = getStandingsEntryForTeam(standings, match.getTeam1()); + var standingTeam2 = getStandingsEntryForTeam(standings, match.getTeam2()); + + standingTeam1.setPlayed(standingTeam1.getPlayed() + 1); + standingTeam2.setPlayed(standingTeam2.getPlayed() + 1); + + standingTeam1.setPointsWon(standingTeam1.getPointsWon() + match.getGames().get(0).getScore1()); + standingTeam2.setPointsWon(standingTeam2.getPointsWon() + match.getGames().get(0).getScore2()); + standingTeam1.setPointsLost(standingTeam1.getPointsLost() + match.getGames().get(0).getScore2()); + standingTeam2.setPointsLost(standingTeam2.getPointsLost() + match.getGames().get(0).getScore1()); + + standingTeam1.setPointsWon(standingTeam1.getPointsWon() + match.getGames().get(1).getScore1()); + standingTeam2.setPointsWon(standingTeam2.getPointsWon() + match.getGames().get(1).getScore2()); + standingTeam1.setPointsLost(standingTeam1.getPointsLost() + match.getGames().get(1).getScore2()); + standingTeam2.setPointsLost(standingTeam2.getPointsLost() + match.getGames().get(1).getScore1()); + + if (match.getGames().size() == 3) { + standingTeam1.setPointsWon(standingTeam1.getPointsWon() + match.getGames().get(2).getScore1()); + standingTeam2.setPointsWon(standingTeam2.getPointsWon() + match.getGames().get(2).getScore2()); + standingTeam1.setPointsLost(standingTeam1.getPointsLost() + match.getGames().get(2).getScore2()); + standingTeam2.setPointsLost(standingTeam2.getPointsLost() + match.getGames().get(2).getScore1()); + + if (match.getGames().get(2).getScore1() > match.getGames().get(2).getScore2()) { + standingTeam1.setWon(standingTeam1.getWon() + 1); + standingTeam1.setPoints(standingTeam1.getPoints() + 2); + standingTeam1.setGamesWon(standingTeam1.getGamesWon() + 2); + standingTeam1.setGamesLost(standingTeam1.getGamesLost() + 1); + + standingTeam2.setLost(standingTeam2.getLost() + 1); + standingTeam2.setGamesWon(standingTeam2.getGamesWon() + 1); + standingTeam2.setGamesLost(standingTeam2.getGamesLost() + 2); + } else { + standingTeam1.setLost(standingTeam1.getLost() + 1); + standingTeam1.setGamesWon(standingTeam1.getGamesWon() + 1); + standingTeam1.setGamesLost(standingTeam1.getGamesLost() + 2); + + standingTeam2.setWon(standingTeam2.getWon() + 1); + standingTeam2.setPoints(standingTeam2.getPoints() + 2); + standingTeam2.setGamesWon(standingTeam2.getGamesWon() + 2); + standingTeam2.setGamesLost(standingTeam2.getGamesLost() + 1); + } + } else { + if (match.getGames().get(1).getScore1() > match.getGames().get(1).getScore2()) { + standingTeam1.setWon(standingTeam1.getWon() + 1); + standingTeam1.setPoints(standingTeam1.getPoints() + 2); + standingTeam1.setGamesWon(standingTeam1.getGamesWon() + 2); + + standingTeam2.setLost(standingTeam2.getLost() + 1); + standingTeam2.setGamesLost(standingTeam2.getGamesLost() + 2); + } else { + standingTeam1.setLost(standingTeam1.getLost() + 1); + standingTeam1.setGamesLost(standingTeam2.getGamesLost() + 2); + + standingTeam2.setWon(standingTeam2.getWon() + 1); + standingTeam2.setPoints(standingTeam2.getPoints() + 2); + standingTeam2.setGamesWon(standingTeam2.getGamesWon() + 2); + } + } + } + + private StandingsEntry getStandingsEntryForTeam(List standings, Team team) { + return standings.stream().filter(standingsEntry -> Objects.equals(standingsEntry.getTeam(), team)).findAny().orElse(null); + } + + private List sortStandings(List standings) { + var sortedStandings = standings + .stream() + .sorted(StandingsEntry::compare) + .toList(); + + var position = 0L; + for (var standing : sortedStandings) { + standing.setPosition(++position); + } + return sortedStandings; + } + +} diff --git a/src/main/java/nl/connectedit/swiss/service/TournamentDivideService.java b/src/main/java/nl/connectedit/swiss/service/TournamentDivideService.java new file mode 100644 index 0000000..a061d6b --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/TournamentDivideService.java @@ -0,0 +1,157 @@ +package nl.connectedit.swiss.service; + +import jakarta.transaction.Transactional; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.EventType; +import nl.connectedit.swiss.domain.Status; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.domain.entity.Event; +import nl.connectedit.swiss.domain.entity.Group; +import nl.connectedit.swiss.domain.entity.Registration; +import nl.connectedit.swiss.domain.entity.Team; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.repository.TournamentRepository; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class TournamentDivideService { + + private final TournamentValidationService tournamentValidationService; + + private final TournamentRepository tournamentRepository; + + @Transactional + public Tournament divide(Tournament tournament) { + if (tournamentValidationService.validate(tournament).hasErrors()) { + return tournament; + } + + for (var event : tournament.getEvents()) { + if (event.getRegistrations().size() >= 4) { + divide(event); + } + } + + tournament.setStatus(TournamentStatus.DIVIDED); + + tournamentRepository.save(tournament); + + return tournament; + } + + public void divide(Event event) { + List registrations; + if (event.getType().isDoublesEvent()) { + registrations = groupRegistrations(event.getRegistrations()); + } else { + registrations = event.getRegistrations(); + } + + event.setGroups(new ArrayList<>()); + + if (registrations.size() <= 16) { + var group = getGroup(registrations, event.getType()); + group.setEvent(event); + event.getGroups().add(group); + } else { + var groups = getGroups(registrations, event.getType()); + event.getGroups().addAll(groups); + } + } + + private List groupRegistrations(List registrations) { + var groupedRegistrations = new ArrayList(); + +nextRegistration: + for (var registration : registrations) { + for (var groupedRegistration : groupedRegistrations) { + if (Objects.equals(groupedRegistration.getPartner(), registration.getPlayer())) { + continue nextRegistration; + } + } + groupedRegistrations.add(registration); + } + return groupedRegistrations; + } + + private Group getGroup(List registrations, EventType type) { + var group = new Group(); + group.setName(type.getText()); + group.setType(type); + group.setStatus(Status.IN_PROGRESS); + group.setTeams(new ArrayList<>()); + for (var registration : registrations) { + group.getTeams().add(getTeam(registration, group)); + } + + return group; + } + + private List getGroups(List orgRegistrations, EventType type) { + var registrations = new ArrayList<>(orgRegistrations); + + var group1 = new Group(); + group1.setName(type.getText() + " 1"); + group1.setType(type); + group1.setStatus(Status.IN_PROGRESS); + group1.setTeams(new ArrayList<>()); + var group2 = new Group(); + group2.setName(type.getText() + " 2"); + group2.setType(type); + group2.setStatus(Status.IN_PROGRESS); + group2.setTeams(new ArrayList<>()); + + var registrationStrengthMap = new HashMap(); + for (var registration : registrations) { + var strength = registration.getPlayer().getStrength().getCoefficient(); + if (registration.getPartner() != null) { + strength += registration.getPartner().getStrength().getCoefficient(); + } + registrationStrengthMap.put(registration, strength); + } + + var sortedRegistrations = registrationStrengthMap + .entrySet() + .stream() + .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) + .map(Map.Entry::getKey) + .toList(); + + for (Iterator i = sortedRegistrations.iterator(); i.hasNext(); ) { + group1.getTeams().add(getTeam(i.next(), group1)); + if (i.hasNext()) { + group2.getTeams().add(getTeam(i.next(), group2)); + } + } + + return List.of(group1, group2); + } + + private Team getTeam(Registration registration, Group group) { + var team = new Team(); + team.setPlayer1(registration.getPlayer()); + team.setPlayer2(registration.getPartner()); + team.setGroup(group); + + return team; + } + + public Tournament clear(Tournament tournament) { + for (var event : tournament.getEvents()) { + event.getGroups().clear(); + } + tournament.setStatus(TournamentStatus.UPCOMING); + + tournamentRepository.save(tournament); + + return tournament; + } +} diff --git a/src/main/java/nl/connectedit/swiss/service/TournamentDrawService.java b/src/main/java/nl/connectedit/swiss/service/TournamentDrawService.java new file mode 100644 index 0000000..c7c2a19 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/TournamentDrawService.java @@ -0,0 +1,183 @@ +package nl.connectedit.swiss.service; + +import java.util.*; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.Status; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.domain.entity.*; +import nl.connectedit.swiss.repository.TournamentRepository; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class TournamentDrawService { + + private final TournamentRepository tournamentRepository; + + public Tournament draw(Tournament tournament) { + if (!tournamentIsReadyForDraw(tournament)) return null; + + for (var event : tournament.getEvents()) { + for (var group : event.getGroups()) { + var round = new Round(); + round.setName("Ronde 1"); + round.setGroup(group); + round.setMatches(createMatchList(group, round)); + round.setStatus(Status.NOT_STARTED); + group.getRounds().add(round); + } + } + + registerTournamentPlayers(tournament); + + tournament.setStatus(TournamentStatus.DRAWN); + + tournamentRepository.save(tournament); + + return tournament; + } + + private void registerTournamentPlayers(Tournament tournament) { + var players = new HashSet(); + for (var event : tournament.getEvents()) { + for (var group : event.getGroups()) { + for (var team : group.getTeams()) { + players.add(team.getPlayer1()); + if (team.getPlayer2() != null) players.add(team.getPlayer2()); + } + } + } + for (var player : players) { + var tournamentPlayer = new TournamentPlayer(); + tournamentPlayer.setTournament(tournament); + tournamentPlayer.setPlayer(player); + tournamentPlayer.setEvents( + tournament.getEvents() + .stream() + .filter(event -> + event.getRegistrations() + .stream() + .anyMatch(r -> r.getPlayer().equals(player))) + .map(Event::getType) + .map(Enum::name) + .toList() + ); + tournament.getTournamentPlayers().add(tournamentPlayer); + } + } + + public Tournament clear(Tournament tournament) { + if (!tournamentIsDrawn(tournament)) return tournament; + + for (var event : tournament.getEvents()) { + for (var group : event.getGroups()) { + group.getRounds().clear(); + } + } + + tournament.getTournamentPlayers().clear(); + + tournament.setStatus(TournamentStatus.DIVIDED); + + tournamentRepository.save(tournament); + + return tournament; + } + + private List createMatchList(Group group, Round round) { + List matches; + var drawCounter = 0; + do { + drawCounter++; + matches = new ArrayList<>(); + var teams = new ArrayList<>(group.getTeams()); + + Collections.shuffle(teams); + + for (Iterator i = teams.iterator(); i.hasNext(); ) { + var match = new Match(); + match.setType(group.getType()); + match.setStatus(Status.NOT_STARTED); + match.setTeam1(i.next()); + if (i.hasNext()) { + match.setTeam2(i.next()); + } else { + round.setDrawnOut(match.getTeam1()); + break; + } + match.setPlayed(false); + match.setRound(round); + matches.add(match); + } + } while (!drawIsValid(matches) || drawCounter == 1000); + + return matches; + } + + private boolean drawIsValid(List matches) { + for (var match : matches) { + var clubs = getClubsFromMatch(match); + var distinctClubs = new HashSet<>(clubs).size(); + if (!match.getType().isDoublesEvent()) { + if (distinctClubs == 1) { + return false; + } + } else { + if (distinctClubs == 1) { + return false; + } else if (distinctClubs == 2 && (teamPlayersHaveDifferentClub(match.getTeam1()) ^ teamPlayersHaveDifferentClub(match.getTeam2()))) { + return false; + } + } + } + return true; + } + + private List getClubsFromMatch(Match match) { + var clubs = new ArrayList(); + + clubs.add(match.getTeam1().getPlayer1().getClub()); + if (match.getTeam1().getPlayer2() != null) { + clubs.add(match.getTeam1().getPlayer2().getClub()); + } + clubs.add(match.getTeam2().getPlayer1().getClub()); + if (match.getTeam2().getPlayer2() != null) { + clubs.add(match.getTeam2().getPlayer2().getClub()); + } + + return clubs; + } + + private boolean teamPlayersHaveDifferentClub(Team team) { + if (team.getPlayer2() == null) return true; + + return !Objects.equals(team.getPlayer1().getClub(), team.getPlayer2().getClub()); + } + + private boolean tournamentIsReadyForDraw(Tournament tournament) { + return tournament.getStatus() == TournamentStatus.DIVIDED && + tournament.getEvents() + .stream() + .map(Event::getGroups) + .flatMap(List::stream) + .map(Group::getRounds) + .flatMap(List::stream) + .toList() + .isEmpty(); + } + + private boolean tournamentIsDrawn(Tournament tournament) { + if (tournament.getStatus() != TournamentStatus.DRAWN) return false; + + for (var event : tournament.getEvents()) { + for (var group : event.getGroups()) { + for (var round : group.getRounds()) { + if (round.getStatus() != Status.NOT_STARTED) return false; + } + } + } + + return true; + } +} diff --git a/src/main/java/nl/connectedit/swiss/service/TournamentPlayService.java b/src/main/java/nl/connectedit/swiss/service/TournamentPlayService.java new file mode 100644 index 0000000..eb9e3a7 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/TournamentPlayService.java @@ -0,0 +1,279 @@ +package nl.connectedit.swiss.service; + +import lombok.RequiredArgsConstructor; +import lombok.extern.java.Log; +import nl.connectedit.swiss.domain.Status; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.domain.entity.*; +import nl.connectedit.swiss.dto.ResultDto; +import nl.connectedit.swiss.dto.StandingsEntry; +import nl.connectedit.swiss.repository.TournamentRepository; +import org.springframework.stereotype.Service; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Random; +import java.util.stream.Collectors; + +import static nl.connectedit.swiss.service.ServiceUtil.*; + +@Service +@RequiredArgsConstructor +@Log +public class TournamentPlayService { + + private final TournamentRepository tournamentRepository; + + private final StandingsService standingsService; + + public Tournament startRound(Tournament tournament, Long roundId) { + getRound(tournament, roundId).setStatus(Status.IN_PROGRESS); + tournament.setStatus(TournamentStatus.ONGOING); + tournamentRepository.save(tournament); + return tournament; + } + + public Tournament finishRound(Tournament tournament, Long roundId) { + getRound(tournament, roundId).setStatus(Status.FINISHED); + tournamentRepository.save(tournament); + return tournament; + } + + public Tournament finishGroup(Tournament tournament, Long groupId) { + getGroup(tournament, groupId).setStatus(Status.FINISHED); + tournamentRepository.save(tournament); + return tournament; + } + + public Tournament newRound(Tournament tournament, Long groupId) { + var group = getGroup(tournament, groupId); + + var standings = standingsService.getStandings(group.getRounds(), group.getTeams()); + var remainingTeams = standings.stream() + .map(StandingsEntry::getTeam) + .collect(Collectors.toCollection(ArrayList::new)); + + var round = new Round(); + round.setName("Ronde " + (group.getRounds().size() + 1)); + round.setGroup(group); + round.setStatus(Status.NOT_STARTED); + + if (remainingTeams.size() % 2 == 1) { + var random = new Random(); + var drawnOutPlayers = getDrawnOutPlayers(tournament); + do { + var randomTeam = remainingTeams.get(random.nextInt(remainingTeams.size())); + if (!drawnOutPlayers.contains(randomTeam.getPlayer1()) && (randomTeam.getPlayer2() == null || !drawnOutPlayers.contains(randomTeam.getPlayer2()))) { + remainingTeams.remove(randomTeam); + round.setDrawnOut(randomTeam); + break; + } + } while(true); + } + + var matches = tryMatches(remainingTeams, group).reversed(); + + for (var match : matches) { + match.setType(group.getType()); + match.setStatus(Status.NOT_STARTED); + match.setPlayed(false); + match.setRound(round); + } + + round.setMatches(matches); + + printRound(round, standings); + + group.getRounds().add(round); + + tournamentRepository.save(tournament); + return tournament; + } + + private List getDrawnOutPlayers(Tournament tournament) { + var players = new ArrayList(); + + for (var event : tournament.getEvents()) { + for (var group : event.getGroups()) { + var playersInGroup = group.getTeams().stream() + .map(this::getPlayersInTeam) + .flatMap(List::stream) + .toList(); + + for (var player : playersInGroup) { + for (var round : group.getRounds()) { + var foundInRound = false; + for (var match : round.getMatches()) { + if (playerIsInMatch(match, player)) { + foundInRound = true; + } + } + if (!foundInRound) { + players.add(player); + log.info(player.getFullName() + " is al uitgeloot in het toernooi."); + } + } + } + } + } + return players; + } + + private List getPlayersInTeam(Team team) { + return team.getPlayer2() == null ? List.of(team.getPlayer1()) : List.of(team.getPlayer1(), team.getPlayer2()); + } + + private boolean playerIsInTeam(Team team, Player player) { + return Objects.equals(team.getPlayer1(), player) || Objects.equals(team.getPlayer2(), player); + } + + private boolean playerIsInMatch(Match match, Player player) { + return playerIsInTeam(match.getTeam1(), player) || playerIsInTeam(match.getTeam2(), player); + } + + private void printRound(Round round, List standings) { + for (var match: round.getMatches()) { + log.info("%s - %s".formatted( + String.valueOf(standings.stream().filter(entry -> entry.getTeam().equals(match.getTeam1())).map(StandingsEntry::getPosition).findFirst().get()), + String.valueOf(standings.stream().filter(entry -> entry.getTeam().equals(match.getTeam2())).map(StandingsEntry::getPosition).findFirst().get()))); + } + } + + private static class ConflictInDrawException extends RuntimeException {} + + private List tryMatches(List remainingTeams, Group group) { + var newMatches = new ArrayList(); + if (remainingTeams.isEmpty()) { + return newMatches; + } + var newMatch = new Match(); + newMatch.setTeam1(remainingTeams.getFirst()); + for (var opponentIndex = 1; opponentIndex < remainingTeams.size(); opponentIndex++) { + if (!findPreviousMatchOccurence(newMatch.getTeam1(), remainingTeams.get(opponentIndex), group)) { + newMatch.setTeam2(remainingTeams.get(opponentIndex)); + } else { + log.info("Wedstrijd %s - %s kwam al eerder voor.".formatted(newMatch.getTeam1().toString(), remainingTeams.get(opponentIndex).toString())); + continue; + } + var newRemainingTeams = getRemainingTeams(remainingTeams, opponentIndex); + if (newRemainingTeams.size() == 1) { + newMatches.add(newMatch); + break; + } else { + try { + newMatches.addAll(tryMatches(newRemainingTeams, group)); + newMatches.add(newMatch); + break; + } catch (ConflictInDrawException ignored) { + } + } + } + if (newMatch.getTeam2() == null) { + log.info("Geen tegenstander gevonden voor %s.".formatted(newMatch.getTeam1().toString())); + throw new ConflictInDrawException(); + } + + return newMatches; + } + + private List getRemainingTeams(List remainingTeams, int opponentIndex) { + var newRemainingTeams = new ArrayList(); + for (var remainingTeamIndex = 1; remainingTeamIndex < remainingTeams.size(); remainingTeamIndex++) { + if (remainingTeamIndex == opponentIndex) continue; + newRemainingTeams.add(remainingTeams.get(remainingTeamIndex)); + } + return newRemainingTeams; + } + + private boolean findPreviousMatchOccurence(Team team1, Team team2, Group group) { + for (var round : group.getRounds()) { + for (var match : round.getMatches()) { + if ((Objects.equals(match.getTeam1(), team1) && Objects.equals(match.getTeam2(), team2)) + || (Objects.equals(match.getTeam1(), team2) && Objects.equals(match.getTeam2(), team1))) { + return true; + } + } + } + return false; + } + + private boolean playerHasSkippedRoundBefore(Player player, Tournament tournament) { + var hasSkippedRound = false; + + return hasSkippedRound; + } + + public Tournament startMatch(Tournament tournament, Long matchId, Long court) { + var match = getMatch(tournament, matchId); + match.setStatus(Status.IN_PROGRESS); + match.setStartTime(LocalDateTime.now()); + match.setCourt(court); + tournamentRepository.save(tournament); + return tournament; + } + + public Tournament stopMatch(Tournament tournament, Long matchId) { + var match = getMatch(tournament, matchId); + match.setStatus(Status.NOT_STARTED); + match.setStartTime(null); + match.setCourt(null); + tournamentRepository.save(tournament); + return tournament; + } + + public Tournament saveResult(Tournament tournament, Long matchId, ResultDto result) { + var match = getMatch(tournament, matchId); + if (match.getGames().isEmpty()) { + match.setEndTime(LocalDateTime.now()); + match.setStatus(Status.FINISHED); + match.setPlayed(true); + } + match.getGames().clear(); + match.getGames().addAll(resultToGames(result, match)); + + tournamentRepository.save(tournament); + return tournament; + } + + private List resultToGames(ResultDto result, Match match) { + var games = new ArrayList(); + for (var game : result.getGames()) { + if (game.getScore1() != null) { + games.add(Game.builder() + .score1(game.getScore1()) + .score2(game.getScore2()) + .match(match) + .build()); + } + } + + return games; + } + + public void updatePaid(Tournament tournament, Long playerId, Boolean paid) { + var tournamentPlayer = tournament.getTournamentPlayers() + .stream() + .filter(player -> player.getPlayer().getId().equals(playerId)) + .findFirst() + .get(); + + tournamentPlayer.setPaid(paid); + + tournamentRepository.save(tournament); + } + + public void updatePresent(Tournament tournament, Long playerId, Boolean present) { + var tournamentPlayer = tournament.getTournamentPlayers() + .stream() + .filter(player -> player.getPlayer().getId().equals(playerId)) + .findFirst() + .get(); + + tournamentPlayer.setPresent(present); + + tournamentRepository.save(tournament); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/service/TournamentService.java b/src/main/java/nl/connectedit/swiss/service/TournamentService.java new file mode 100644 index 0000000..39712d1 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/TournamentService.java @@ -0,0 +1,43 @@ +package nl.connectedit.swiss.service; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.entity.Tournament; +import nl.connectedit.swiss.domain.TournamentStatus; +import nl.connectedit.swiss.repository.TournamentRepository; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +@RequiredArgsConstructor +public class TournamentService { + + private final TournamentRepository tournamentRepository; + + public List findAllTournaments() { + return tournamentRepository.findAll(); + } + + public List findAllTournamentsWithStatus(TournamentStatus status) { + return tournamentRepository.findAllByStatus(status); + } + + public Tournament findTournamentById(Long id) { + return tournamentRepository.findById(id).orElse(null); + } + + public Tournament saveTournament(Tournament tournament) { + return tournamentRepository.save(tournament); + } + + public Tournament updateTournament(Long tournamentId, Tournament newTournament) { + Tournament tournament = findTournamentById(tournamentId); + tournament.setName(newTournament.getName()); + tournament.setDate(newTournament.getDate()); + tournament.setMaxEvents(newTournament.getMaxEvents()); + tournament.setCostsPerEvent(newTournament.getCostsPerEvent()); + tournament.setCourts(newTournament.getCourts()); + return tournamentRepository.save(tournament); + } + +} diff --git a/src/main/java/nl/connectedit/swiss/service/TournamentValidationService.java b/src/main/java/nl/connectedit/swiss/service/TournamentValidationService.java new file mode 100644 index 0000000..2f59736 --- /dev/null +++ b/src/main/java/nl/connectedit/swiss/service/TournamentValidationService.java @@ -0,0 +1,223 @@ +package nl.connectedit.swiss.service; + +import lombok.RequiredArgsConstructor; +import nl.connectedit.swiss.domain.*; +import nl.connectedit.swiss.domain.entity.Event; +import nl.connectedit.swiss.domain.entity.Player; +import nl.connectedit.swiss.domain.entity.Registration; +import nl.connectedit.swiss.domain.entity.Tournament; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +import static nl.connectedit.swiss.domain.Validation.Severity.*; + +@Service +@RequiredArgsConstructor +public class TournamentValidationService { + + private final PlayerService playerService; + + public TournamentValidation validate(Tournament tournament) { + var players = playerService.findAllPlayers(); + + TournamentValidation tournamentValidation = new TournamentValidation(); + tournamentValidation.setTournamentId(tournament.getId()); + + var validations = new ArrayList(); + checkForTooManyRegistrationsPerPlayer(tournament, players, validations); + + tournamentValidation.setValidations(validations); + + tournamentValidation.setEventValidations(tournament + .getEvents() + .stream() + .map(this::validate) + .toList() + ); + + return tournamentValidation; + } + + private EventValidation validate(Event event) { + var validations = new ArrayList(); + + if (event.getStatus() != Status.NOT_STARTED) { + return EventValidation.builder().eventId(event.getId()).build(); + } + + checkNumberOfRegistrations(event, validations); + checkMultipleGroupsNeeded(event, validations); + + if (event.getType().isDoublesEvent()) { + checkForEmptyPartnerRegistrations(event, validations); + checkForInvalidPartnerRegistrations(event, validations); + checkForMultiplePartnerRegistrations(event, validations); + } + + return EventValidation.builder().eventId(event.getId()).validations(validations).build(); + + } + + private void checkNumberOfRegistrations(Event event, List validations) { + if (event.getRegistrations().isEmpty()) { + addValidation(validations, ERROR, "Geen inschrijvingen"); + } else if (event.getRegistrations().size() < 4 ) { + addValidation(validations, ERROR, "Te weinig inschrijvingen"); + } + } + + private void checkMultipleGroupsNeeded(Event event, List validations) { + if (event.getType().isDoublesEvent()) { + if (event.getRegistrations().size() > 32) { + addValidation(validations, WARN, "Meer dan 32 inschrijvingen, 2 groepen nodig"); + } + } else { + if (event.getRegistrations().size() > 16) { + addValidation(validations, WARN, "Meer dan 16 inschrijvingen, 2 groepen nodig"); + } + } + } + + private void checkForEmptyPartnerRegistrations(Event event, List validations) { + var registrations = event.getRegistrations(); + + for (var registration : registrations) { + var partner = registration.getPartner(); + if (partner == null) { + addValidation(validations, ERROR, "%s heeft geen partner", registration.getPlayer().getFullName()); + } + } + } + + private void checkForInvalidPartnerRegistrations(Event event, List validations) { + var registrations = event.getRegistrations(); + + for (var registration : registrations) { + if (registration.getPartner() != null) { + var optionalPartnerRegistration = getRegistrationForPlayer(registrations, registration.getPartner()); + if (optionalPartnerRegistration.isEmpty()) { + addValidation(validations, ERROR, + "%s heeft als geregistreerde partner %s, maar deze staat niet ingeschreven voor het onderdeel %s", + registration.getPlayer().getFullName(), registration.getPartner().getFullName(), event.getType().getText()); + } else { + var partnerRegistration = optionalPartnerRegistration.get(); + var partnerPartner = partnerRegistration.getPartner(); + if (partnerPartner == null) { + addValidation(validations, ERROR, + "%s heeft als geregistreerde partner %s, maar deze heeft nog geen geregistreerde partner", + registration.getPlayer().getFullName(), partnerRegistration.getPlayer().getFullName()); + } else { + if (!Objects.equals(registration.getPlayer(), partnerPartner)) { + addValidation(validations, ERROR, + "%s heeft als geregistreerde partner %s, maar deze staat ingeschreven met partner %s", + registration.getPlayer().getFullName(), partnerRegistration.getPlayer().getFullName(), partnerRegistration.getPartner().getFullName()); + } + } + } + } + } + } + + private void checkForMultiplePartnerRegistrations(Event event, List validations) { + var registrations = event.getRegistrations(); + + for (var registration : registrations) { + var partners = getPartners(registrations, registration.getPlayer()); + if (partners.size() > 1) { + addValidation(validations, ERROR, + "%s is met meerdere spelers als partner geregistreerd (%s)", + registration.getPlayer().getFullName(), getPlayersAsList(partners)); + } + } + } + + private void checkForTooManyRegistrationsPerPlayer(Tournament tournament, List players, List validations) { + var playerRegistrations = new ArrayList(); + for (var player : players) { + playerRegistrations.clear(); + for (var event : tournament.getEvents()) { + var eventRegistration = getRegistrationForPlayer(event.getRegistrations(), player); + eventRegistration.ifPresent(playerRegistrations::add); + } + if (playerRegistrations.size() > tournament.getMaxEvents()) { + addValidation(validations, ERROR, + "%s staat voor meer dan %d onderdelen ingeschreven, nl. %s", + player.getFullName(), tournament.getMaxEvents(), getEventsAsList(playerRegistrations, tournament)); + } + } + } + + private String getEventsAsList(List registrations, Tournament tournament) { + if (registrations.isEmpty()) { + return ""; + } else if (registrations.size() == 1) { + return tournament + .getEvents() + .stream() + .filter(event -> event.getRegistrations().contains(registrations.getFirst())) + .findFirst() + .get() + .getType() + .getText(); + } else { + return String.join(", ", registrations + .stream() + .limit(registrations.size() - 1) + .map(registration -> this.getTypeForRegistration(registration, tournament)) + .map(EventType::getText) + .toList() + ) + " en " + getTypeForRegistration(registrations.getLast(), tournament).getText(); + } + } + + private EventType getTypeForRegistration(Registration registration, Tournament tournament) { + return tournament + .getEvents() + .stream() + .filter(event -> event.getRegistrations().contains(registration)) + .findFirst() + .get() + .getType(); + } + + private String getPlayersAsList(List players) { + if (players.isEmpty()) { + return ""; + } else if (players.size() == 1) { + return players.getFirst().getFullName(); + } else { + return String.join(", ", players + .stream() + .limit(players.size() - 1) + .map(Player::getFullName) + .toList() + ) + " en " + players.getLast().getFullName(); + } + } + + private Optional getRegistrationForPlayer(List registrations, Player player) { + return registrations + .stream() + .filter(registration -> Objects.equals(registration.getPlayer(), player)).findFirst(); + } + + + private List getPartners(List registrations, Player player) { + List partners = new ArrayList<>(); + for (var registration : registrations) { + if (registration.getPartner() != null && registration.getPartner().equals(player)) { + partners.add(registration.getPlayer()); + } + } + return partners; + } + + private void addValidation(List validations, Validation.Severity severity, String message, Object... params) { + validations.add(new Validation(severity, message.formatted(params))); + } + +} diff --git a/src/main/resources/application-local-postgres.yaml b/src/main/resources/application-local-postgres.yaml new file mode 100755 index 0000000..2443128 --- /dev/null +++ b/src/main/resources/application-local-postgres.yaml @@ -0,0 +1,27 @@ +spring: + application: + name: swiss +# autoconfigure: +# exclude: +# - org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration +# - org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration + datasource: + url: jdbc:postgresql://localhost:5432/swiss?currentSchema=swiss + username: ${DB_USERNAME:postgres} + password: ${DB_PASSWORD:postgres} + flyway: + enabled: false + +security: true +#logging: +# level: +# root: DEBUG +#logging: +# level: +# org: +# hibernate: +# sql: DEBUG +# type: +# descriptor: +# sql: +# BasicBinder: TRACE diff --git a/src/main/resources/application-local.yaml b/src/main/resources/application-local.yaml new file mode 100755 index 0000000..147d732 --- /dev/null +++ b/src/main/resources/application-local.yaml @@ -0,0 +1,39 @@ +spring: + application: + name: swiss +# autoconfigure: +# exclude: +# - org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration +# - org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration + datasource: + url: jdbc:h2:file:./localswiss + driver-class-name: org.h2.Driver + username: sa + password: password + jpa: + database-platform: org.hibernate.dialect.H2Dialect + hibernate: + ddl-auto: create-drop + jackson: + serialization: + indent-output: true + flyway: + url: jdbc:h2:file:./localswiss + user: sa + password: password + locations: flyway + baseline-on-migrate: true + +security: true +#logging: +# level: +# root: DEBUG +#logging: +# level: +# org: +# hibernate: +# sql: DEBUG +# type: +# descriptor: +# sql: +# BasicBinder: TRACE diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml new file mode 100755 index 0000000..12e81ee --- /dev/null +++ b/src/main/resources/application.yaml @@ -0,0 +1,33 @@ +spring: + application: + name: swiss +# autoconfigure: +# exclude: +# - org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration +# - org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration + datasource: + url: jdbc:postgresql://${DB_URL:localhost:5432}/swiss?currentSchema=swiss + username: ${DB_USERNAME:postgres} + password: ${DB_PASSWORD:postgres} + jpa: + hibernate: + ddl-auto: none + flyway: + url: jdbc:postgresql://${DB_URL:localhost:5432}/swiss?currentSchema=swiss + user: ${DB_USERNAME:postgres} + password: ${DB_PASSWORD:postgres} + baseline-on-migrate: true + +management: + server: + port: 8081 + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + probes: + enabled: true + +security: true \ No newline at end of file diff --git a/src/main/resources/certs/private.pem b/src/main/resources/certs/private.pem new file mode 100644 index 0000000..9915a8d --- /dev/null +++ b/src/main/resources/certs/private.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCp5PMrGbzVKQSE +LSSkMoJnPUKu0f+ySIRe39qd5r1w07S6TAEqIwBdXwCdwTo8QnggNNxlC3j2pa0J +lKI3cNrnNitcs8oI0jQ4LN/HsN/cwp3V+m0sBaEVt9mZK0qSj2mxx+EnHpLF3Z+L +7EAGPlezpyGKsJHi1hgAXcbKdLcfC/h3g/TtIvPj7VfR86VGArY2VsZQWFsKvkQa +rGVosARQo0b2L/qsqYr9CvCEZ6gSTMS0+xr9Fc9AsYOyuzsw2zHvq8i/L8alK/Tt +CJobZK1O0Kedbv5R1gEU+NhGzrdZe1YwCCg5QZCk6j9NXN8tpMIFpeORsxXWxB72 +Dzc6+/FNAgMBAAECggEAB/mFeYkyfi339o1Y6jUtvlNXkTWtwyxYvExVKnLFgymI +0vLU3im472kRchY7Gc+D7H0WuE5+zdMOiYPWznPnbpFyHR6aVeoqBdYDZg/1Hhtr +hbsEy1tzSX3xApnP3QvKygvIE4pBmPSTc+Gxyqk7/CSU9DngCy4B/+hm96NdYiFd +yI5VByp+DMhk/dtgWFOHZcG4MvrRaLA8ZRnSkCa5QrL+la3lf4M9FJedpo9GvjG6 +c8M+pgLKMmw4bFDqfDyEpYhJxQaAqEMFaiBuMMDymI6OXpzBG92kflK7VvR4YBym +DUhqhmQ4qAe37Wr2vVob+Dsf39IuS+FWDNZSW6lrMQKBgQDnGVBv0Xv3+pb/NmqA +1sRJvhMtFaVkIKJuf1qK7SNzU5tCbNAfaJgQQVFNswnjpbS300T1ehNorsDeDi05 +WqeWdRPY/Qz+19AJ1UiCMUku/SWWN21byUQU4yven6mJ6rgkKbAv4E4VtpcG3q8B +W/aIL1KAHvEFJ3rI21QD4A+NvQKBgQC8M1rlXu64kKbw4D5KormMFvjkoROsXwn/ +eqN0wCN9avD7+LN/MUhqn7S0t0iQJRH+kaOjS6yl1v9JFI8bBLMQ1Uk1Mtpi4Mvl +AWtPLUYXxeP+zlS1ueBuDzRsNUGRqYM1MVlr7sko5gOAPQHHaDbNRYSqaskLtRR0 +/BjItmDC0QKBgGCySOPgxXxnUBMNk9bBBnTMoX111zRkK1MM2rfSrcitrQNIQHVD +8Iysp/ZY+cRVK57XOb11DPX6WR0Q1X9wHTtpVZqvl2ZyqsvSgHppYPPWXInUO1/y +gRg0TcDjEa9xlQccomoF8uZG9j6boqJw9mDZXC3bxIGhmVC95ROSBzAJAoGBAJHz +3dUuV0IpZF4/+e8V3YHIOwPL657tIarQ6Dzd2WglbHhsun+0r62I57KSxaKMLTVY +qygzwtPmNZruZ8ETVu+CCUFJi9XM8jNKc3c27Dn5jUSJrWY1ndic0BHvB0e4x3mU +KP4sdDLUlvh3145WwtFUzXsAT6RVrWTAMVRPJCFRAoGBAMEW8V36c+XJuD9qDvg3 +qG3uPaGS1IytkpSAtfSV+hXJ14N57L/oxPTVyrZKDgu0ic3KAHEJG/WN+SQPfaWT +zj8YnFFeSISRRo4Y1Q4Rg/Yer5fKVdkvGKPR9lCEhbxEBqZz4qSMUHGak1exjTeW +DapsPxEG0wEN8rMoNzYMNuc3 +-----END PRIVATE KEY----- diff --git a/src/main/resources/certs/public.pem b/src/main/resources/certs/public.pem new file mode 100644 index 0000000..bd1affc --- /dev/null +++ b/src/main/resources/certs/public.pem @@ -0,0 +1,9 @@ +-----BEGIN PUBLIC KEY----- +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqeTzKxm81SkEhC0kpDKC +Zz1CrtH/skiEXt/anea9cNO0ukwBKiMAXV8AncE6PEJ4IDTcZQt49qWtCZSiN3Da +5zYrXLPKCNI0OCzfx7Df3MKd1fptLAWhFbfZmStKko9pscfhJx6Sxd2fi+xABj5X +s6chirCR4tYYAF3GynS3Hwv4d4P07SLz4+1X0fOlRgK2NlbGUFhbCr5EGqxlaLAE +UKNG9i/6rKmK/QrwhGeoEkzEtPsa/RXPQLGDsrs7MNsx76vIvy/GpSv07QiaG2St +TtCnnW7+UdYBFPjYRs63WXtWMAgoOUGQpOo/TVzfLaTCBaXjkbMV1sQe9g83Ovvx +TQIDAQAB +-----END PUBLIC KEY----- diff --git a/src/main/resources/db/migration/V1__init.sql b/src/main/resources/db/migration/V1__init.sql new file mode 100644 index 0000000..1bbe3a5 --- /dev/null +++ b/src/main/resources/db/migration/V1__init.sql @@ -0,0 +1,303 @@ +create table player +( + birthday date not null, + id bigint generated by default as identity + primary key, + club varchar(255), + email varchar(255) not null, + first_name varchar(255) not null, + last_name varchar(255) not null, + middle_name varchar(255), + phone_number varchar(255) not null, + sex varchar(255) not null + constraint player_sex_check + check ((sex)::text = ANY ((ARRAY ['M'::character varying, 'V'::character varying])::text[])), + strength varchar(255) not null + constraint player_strength_check + check ((strength)::text = ANY + ((ARRAY ['D5'::character varying, 'D6'::character varying, 'D7'::character varying, 'D8'::character varying, 'D9'::character varying, 'DR'::character varying])::text[])) +); + +create table tournament +( + date date, + courts bigint, + id bigint generated by default as identity + primary key, + max_events bigint, + name varchar(255), + status varchar(255) + constraint tournament_status_check + check ((status)::text = ANY + ((ARRAY ['UPCOMING'::character varying, 'DIVIDED'::character varying, 'DRAWN'::character varying, 'ONGOING'::character varying, 'CLOSED'::character varying])::text[])) +); + +create table event +( + id bigint generated by default as identity + primary key, + tournament_id bigint + constraint fkidhc25ppai44aclt55uu9n0fd + references tournament on delete cascade, + status varchar(255) + constraint event_status_check + check ((status)::text = ANY + ((ARRAY ['NOT_STARTED'::character varying, 'READY_TO_PLAY'::character varying, 'IN_PROGRESS'::character varying, 'FINISHED'::character varying])::text[])), + type varchar(255) + constraint event_type_check + check ((type)::text = ANY + ((ARRAY ['HE'::character varying, 'DE'::character varying, 'HD'::character varying, 'DD'::character varying, 'GD'::character varying])::text[])) +); + +create table eventgroup +( + type smallint + constraint eventgroup_type_check + check ((type >= 0) AND (type <= 4)), + event_id bigint + constraint fksdpnxwfbha8j4fiwcxkfyknhv + references event on delete cascade, + id bigint generated by default as identity + primary key, + name varchar(255), + status varchar(255) + constraint eventgroup_status_check + check ((status)::text = ANY + ((ARRAY ['NOT_STARTED'::character varying, 'READY_TO_PLAY'::character varying, 'IN_PROGRESS'::character varying, 'FINISHED'::character varying])::text[])) +); + +create table event_groups +( + event_id bigint not null + constraint fkd4r6j627kmoyxt2k0814d8k18 + references event on delete cascade, + groups_id bigint not null + unique + constraint fkg4tgtn29hlh54nqxvk3uplupr + references eventgroup on delete cascade +); + +create table registration +( + event_id bigint + constraint fks4x1uat6i8fx26qpdrfwfg3ya + references event on delete cascade, + id bigint generated by default as identity + primary key, + partner_id bigint + constraint fkhmyyu2ljiwo8x10kjfab1pkru + references player on delete cascade, + player_id bigint + constraint fkswk5vywwvd2r4knle35xjygao + references player on delete cascade, + tournament_id bigint + constraint fktfm09huujek0o03wklcg9ewpq + references tournament on delete cascade +); + +create table event_registrations +( + event_id bigint not null + constraint fks4kjleulewhu881p4nygwdi0 + references event on delete cascade, + registrations_id bigint not null + unique + constraint fkl4jouqv1u8b3wvwv97i1cqmm7 + references registration on delete cascade +); + +create table player_partner_registrations +( + partner_registrations_id bigint not null + unique + constraint fkohcyc057xfh1bq2gcjjhx90b5 + references registration on delete cascade, + player_id bigint not null + constraint fk61ldsgn3vwru4tjdiraxrsaeb + references player on delete cascade +); + +create table player_registrations +( + player_id bigint not null + constraint fklc29ku8hopaa9wbmru6dtbax3 + references player on delete cascade, + registrations_id bigint not null + unique + constraint fkasxo61ngph7cyje01l1n1ldhg + references registration on delete cascade +); + +create table team +( + group_id bigint + constraint fk6sh9ago3tae2l8og75kbrf4mx + references eventgroup on delete cascade, + id bigint generated by default as identity + primary key, + player1_id bigint + constraint fkphn10d6c8k5b758iklivfyn5y + references player on delete cascade, + player2_id bigint + constraint fk962rmngjyud0ijcw4w7d9vfs0 + references player on delete cascade +); + +create table eventgroup_teams +( + group_id bigint not null + constraint fk2o8i34jh5bk79ya6pc8w3k9of + references eventgroup on delete cascade, + teams_id bigint not null + unique + constraint fk832tg34v55x5kuma6ia55w4dq + references team on delete cascade +); + +create table round +( + status smallint + constraint round_status_check + check ((status >= 0) AND (status <= 3)), + drawn_out_id bigint + constraint fk3w19bu9yiv9px837huabw6abs + references team on delete cascade, + group_id bigint + constraint fk3ytfpp2rat10y2x43g7cl61p3 + references eventgroup on delete cascade, + id bigint generated by default as identity + primary key, + name varchar(255) +); + +create table eventgroup_rounds +( + group_id bigint not null + constraint fksghgh2lq09c28y7xcsmvwd63s + references eventgroup on delete cascade, + rounds_id bigint not null + unique + constraint fkkl6r766uq2l1wpe2yals44nyw + references round on delete cascade +); + +create table match +( + played boolean, + status smallint + constraint match_status_check + check ((status >= 0) AND (status <= 3)), + type smallint + constraint match_type_check + check ((type >= 0) AND (type <= 4)), + court bigint, + end_time timestamp(6), + id bigint generated by default as identity + primary key, + round_id bigint + constraint fkol8rkyfucvsv37sd7kebpm1nw + references round on delete cascade, + start_time timestamp(6), + team1_id bigint + constraint fkglt3t5urqflayn544lpn5ua3s + references team on delete cascade, + team2_id bigint + constraint fkci4coem3xydhawrap0y36qlmg + references team on delete cascade +); + +create table game +( + id bigint generated by default as identity + primary key, + match_id bigint + constraint fkkspobx32vu8ykuguwl3u0nuhd + references match on delete cascade, + score1 bigint, + score2 bigint +); + +create table match_games +( + games_id bigint not null + unique + constraint fkqt1fsmogbyfoo0w5bilc6rmku + references game on delete cascade, + match_id bigint not null + constraint fkgab11a4ifq5ygm14rpsrvrsuh + references match on delete cascade +); + +create table round_matches +( + matches_id bigint not null + unique + constraint fk9quwtp4ipel9hm56p4oh0f4fh + references match on delete cascade, + round_id bigint not null + constraint fkr8lyri4t4xil8ajv8e3gjrd47 + references round on delete cascade +); + +create table round_quit +( + quit_id bigint not null + unique + constraint fkgjta0bnl9jey9c64pmcbbnj5v + references team on delete cascade, + round_id bigint not null + constraint fknkc29tpads6tq669y77d0dvwh + references round on delete cascade +); + +create table tournament_costs_per_event +( + costs_per_event real, + tournament_id bigint not null + constraint fkts9nbg8r28e9ncafhnhdohai + references tournament on delete cascade +); + +create table tournament_events +( + events_id bigint not null + unique + constraint fkfo9dvc9isnkm8hj8il8ajiea6 + references event on delete cascade, + tournament_id bigint not null + constraint fkb4la5xkmiin27q1du88n7gbxs + references tournament on delete cascade +); + +create table tournament_player +( + paid boolean not null, + present boolean not null, + id bigint generated by default as identity + primary key, + player_id bigint + constraint fkrqw4qfs65btri9sfkbof5xyxq + references player on delete cascade, + tournament_id bigint + constraint fkrrm3jbmm1fxx5t9t5f8t46ebc + references tournament on delete cascade +); + +create table tournament_tournament_players +( + tournament_id bigint not null + constraint fkn7jcr3q0c3lh5gm93t0piyjyt + references tournament on delete cascade, + tournament_players_id bigint not null + unique + constraint fkhhmn6g3oxtqiu99ch61h1ubcf + references tournament_player on delete cascade +); + +create table tournament_player_events +( + tournament_player_id bigint not null + constraint fksihteat3lqwdp92fkp33oglqt + references tournament_player on delete cascade, + events varchar(255) +); diff --git a/src/main/resources/export.sql b/src/main/resources/export.sql new file mode 100755 index 0000000..a0b5f08 --- /dev/null +++ b/src/main/resources/export.sql @@ -0,0 +1,3903 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 16.3 +-- Dumped by pg_dump version 16.4 + +-- Started on 2024-10-11 16:03:38 UTC + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- TOC entry 8 (class 2615 OID 17182) +-- Name: swiss; Type: SCHEMA; Schema: -; Owner: swiss-user +-- + +CREATE SCHEMA swiss; + + +ALTER SCHEMA swiss OWNER TO "swiss-user"; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- TOC entry 257 (class 1259 OID 17212) +-- Name: event; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.event ( + id bigint NOT NULL, + tournament_id bigint, + status character varying(255), + type character varying(255), + CONSTRAINT event_status_check CHECK (((status)::text = ANY (ARRAY[('NOT_STARTED'::character varying)::text, ('READY_TO_PLAY'::character varying)::text, ('IN_PROGRESS'::character varying)::text, ('FINISHED'::character varying)::text]))), + CONSTRAINT event_type_check CHECK (((type)::text = ANY (ARRAY[('HE'::character varying)::text, ('DE'::character varying)::text, ('HD'::character varying)::text, ('DD'::character varying)::text, ('GD'::character varying)::text]))) +); + + +ALTER TABLE swiss.event OWNER TO "swiss-user"; + +-- +-- TOC entry 260 (class 1259 OID 17241) +-- Name: event_groups; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.event_groups ( + event_id bigint NOT NULL, + groups_id bigint NOT NULL +); + + +ALTER TABLE swiss.event_groups OWNER TO "swiss-user"; + +-- +-- TOC entry 256 (class 1259 OID 17211) +-- Name: event_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.event ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.event_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 263 (class 1259 OID 17282) +-- Name: event_registrations; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.event_registrations ( + event_id bigint NOT NULL, + registrations_id bigint NOT NULL +); + + +ALTER TABLE swiss.event_registrations OWNER TO "swiss-user"; + +-- +-- TOC entry 259 (class 1259 OID 17227) +-- Name: eventgroup; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.eventgroup ( + type smallint, + event_id bigint, + id bigint NOT NULL, + name character varying(255), + status character varying(255), + CONSTRAINT eventgroup_status_check CHECK (((status)::text = ANY (ARRAY[('NOT_STARTED'::character varying)::text, ('READY_TO_PLAY'::character varying)::text, ('IN_PROGRESS'::character varying)::text, ('FINISHED'::character varying)::text]))), + CONSTRAINT eventgroup_type_check CHECK (((type >= 0) AND (type <= 4))) +); + + +ALTER TABLE swiss.eventgroup OWNER TO "swiss-user"; + +-- +-- TOC entry 258 (class 1259 OID 17226) +-- Name: eventgroup_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.eventgroup ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.eventgroup_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 271 (class 1259 OID 17380) +-- Name: eventgroup_rounds; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.eventgroup_rounds ( + group_id bigint NOT NULL, + rounds_id bigint NOT NULL +); + + +ALTER TABLE swiss.eventgroup_rounds OWNER TO "swiss-user"; + +-- +-- TOC entry 268 (class 1259 OID 17348) +-- Name: eventgroup_teams; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.eventgroup_teams ( + group_id bigint NOT NULL, + teams_id bigint NOT NULL +); + + +ALTER TABLE swiss.eventgroup_teams OWNER TO "swiss-user"; + +-- +-- TOC entry 251 (class 1259 OID 17183) +-- Name: flyway_schema_history; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.flyway_schema_history ( + installed_rank integer NOT NULL, + version character varying(50), + description character varying(200) NOT NULL, + type character varying(20) NOT NULL, + script character varying(1000) NOT NULL, + checksum integer, + installed_by character varying(100) NOT NULL, + installed_on timestamp without time zone DEFAULT now() NOT NULL, + execution_time integer NOT NULL, + success boolean NOT NULL +); + + +ALTER TABLE swiss.flyway_schema_history OWNER TO "swiss-user"; + +-- +-- TOC entry 275 (class 1259 OID 17419) +-- Name: game; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.game ( + id bigint NOT NULL, + match_id bigint, + score1 bigint, + score2 bigint +); + + +ALTER TABLE swiss.game OWNER TO "swiss-user"; + +-- +-- TOC entry 274 (class 1259 OID 17418) +-- Name: game_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.game ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.game_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 273 (class 1259 OID 17396) +-- Name: match; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.match ( + played boolean, + status smallint, + type smallint, + court bigint, + end_time timestamp(6) without time zone, + id bigint NOT NULL, + round_id bigint, + start_time timestamp(6) without time zone, + team1_id bigint, + team2_id bigint, + CONSTRAINT match_status_check CHECK (((status >= 0) AND (status <= 3))), + CONSTRAINT match_type_check CHECK (((type >= 0) AND (type <= 4))) +); + + +ALTER TABLE swiss.match OWNER TO "swiss-user"; + +-- +-- TOC entry 276 (class 1259 OID 17429) +-- Name: match_games; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.match_games ( + games_id bigint NOT NULL, + match_id bigint NOT NULL +); + + +ALTER TABLE swiss.match_games OWNER TO "swiss-user"; + +-- +-- TOC entry 272 (class 1259 OID 17395) +-- Name: match_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.match ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.match_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 253 (class 1259 OID 17193) +-- Name: player; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.player ( + birthday date NOT NULL, + id bigint NOT NULL, + club character varying(255), + email character varying(255) NOT NULL, + first_name character varying(255) NOT NULL, + last_name character varying(255) NOT NULL, + middle_name character varying(255), + phone_number character varying(255) NOT NULL, + sex character varying(255) NOT NULL, + strength character varying(255) NOT NULL, + CONSTRAINT player_sex_check CHECK (((sex)::text = ANY (ARRAY[('M'::character varying)::text, ('V'::character varying)::text]))), + CONSTRAINT player_strength_check CHECK (((strength)::text = ANY (ARRAY[('D5'::character varying)::text, ('D6'::character varying)::text, ('D7'::character varying)::text, ('D8'::character varying)::text, ('D9'::character varying)::text, ('DR'::character varying)::text]))) +); + + +ALTER TABLE swiss.player OWNER TO "swiss-user"; + +-- +-- TOC entry 252 (class 1259 OID 17192) +-- Name: player_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.player ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.player_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 264 (class 1259 OID 17297) +-- Name: player_partner_registrations; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.player_partner_registrations ( + partner_registrations_id bigint NOT NULL, + player_id bigint NOT NULL +); + + +ALTER TABLE swiss.player_partner_registrations OWNER TO "swiss-user"; + +-- +-- TOC entry 265 (class 1259 OID 17312) +-- Name: player_registrations; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.player_registrations ( + player_id bigint NOT NULL, + registrations_id bigint NOT NULL +); + + +ALTER TABLE swiss.player_registrations OWNER TO "swiss-user"; + +-- +-- TOC entry 262 (class 1259 OID 17257) +-- Name: registration; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.registration ( + event_id bigint, + id bigint NOT NULL, + partner_id bigint, + player_id bigint, + tournament_id bigint +); + + +ALTER TABLE swiss.registration OWNER TO "swiss-user"; + +-- +-- TOC entry 261 (class 1259 OID 17256) +-- Name: registration_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.registration ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.registration_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 270 (class 1259 OID 17364) +-- Name: round; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.round ( + status smallint, + drawn_out_id bigint, + group_id bigint, + id bigint NOT NULL, + name character varying(255), + CONSTRAINT round_status_check CHECK (((status >= 0) AND (status <= 3))) +); + + +ALTER TABLE swiss.round OWNER TO "swiss-user"; + +-- +-- TOC entry 269 (class 1259 OID 17363) +-- Name: round_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.round ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.round_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 277 (class 1259 OID 17444) +-- Name: round_matches; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.round_matches ( + matches_id bigint NOT NULL, + round_id bigint NOT NULL +); + + +ALTER TABLE swiss.round_matches OWNER TO "swiss-user"; + +-- +-- TOC entry 278 (class 1259 OID 17459) +-- Name: round_quit; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.round_quit ( + quit_id bigint NOT NULL, + round_id bigint NOT NULL +); + + +ALTER TABLE swiss.round_quit OWNER TO "swiss-user"; + +-- +-- TOC entry 267 (class 1259 OID 17328) +-- Name: team; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.team ( + group_id bigint, + id bigint NOT NULL, + player1_id bigint, + player2_id bigint +); + + +ALTER TABLE swiss.team OWNER TO "swiss-user"; + +-- +-- TOC entry 266 (class 1259 OID 17327) +-- Name: team_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.team ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.team_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 255 (class 1259 OID 17203) +-- Name: tournament; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament ( + date date, + courts bigint, + id bigint NOT NULL, + max_events bigint, + name character varying(255), + status character varying(255), + CONSTRAINT tournament_status_check CHECK (((status)::text = ANY (ARRAY[('UPCOMING'::character varying)::text, ('DIVIDED'::character varying)::text, ('DRAWN'::character varying)::text, ('ONGOING'::character varying)::text, ('CLOSED'::character varying)::text]))) +); + + +ALTER TABLE swiss.tournament OWNER TO "swiss-user"; + +-- +-- TOC entry 279 (class 1259 OID 17474) +-- Name: tournament_costs_per_event; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_costs_per_event ( + costs_per_event real, + tournament_id bigint NOT NULL +); + + +ALTER TABLE swiss.tournament_costs_per_event OWNER TO "swiss-user"; + +-- +-- TOC entry 280 (class 1259 OID 17482) +-- Name: tournament_events; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_events ( + events_id bigint NOT NULL, + tournament_id bigint NOT NULL +); + + +ALTER TABLE swiss.tournament_events OWNER TO "swiss-user"; + +-- +-- TOC entry 254 (class 1259 OID 17202) +-- Name: tournament_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.tournament ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.tournament_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 282 (class 1259 OID 17498) +-- Name: tournament_player; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_player ( + paid boolean NOT NULL, + present boolean NOT NULL, + id bigint NOT NULL, + player_id bigint, + tournament_id bigint +); + + +ALTER TABLE swiss.tournament_player OWNER TO "swiss-user"; + +-- +-- TOC entry 284 (class 1259 OID 17528) +-- Name: tournament_player_events; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_player_events ( + tournament_player_id bigint NOT NULL, + events character varying(255) +); + + +ALTER TABLE swiss.tournament_player_events OWNER TO "swiss-user"; + +-- +-- TOC entry 281 (class 1259 OID 17497) +-- Name: tournament_player_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.tournament_player ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.tournament_player_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 283 (class 1259 OID 17513) +-- Name: tournament_tournament_players; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_tournament_players ( + tournament_id bigint NOT NULL, + tournament_players_id bigint NOT NULL +); + + +ALTER TABLE swiss.tournament_tournament_players OWNER TO "swiss-user"; + +-- +-- TOC entry 3604 (class 0 OID 17212) +-- Dependencies: 257 +-- Data for Name: event; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.event (id, tournament_id, status, type) FROM stdin; +21 5 NOT_STARTED HE +22 5 NOT_STARTED DE +23 5 NOT_STARTED HD +24 5 NOT_STARTED DD +25 5 NOT_STARTED GD +26 6 NOT_STARTED HE +27 6 NOT_STARTED DE +28 6 NOT_STARTED HD +29 6 NOT_STARTED DD +30 6 NOT_STARTED GD +31 7 NOT_STARTED HE +32 7 NOT_STARTED DE +33 7 NOT_STARTED HD +34 7 NOT_STARTED DD +35 7 NOT_STARTED GD +36 8 NOT_STARTED HE +37 8 NOT_STARTED DE +38 8 NOT_STARTED HD +39 8 NOT_STARTED DD +40 8 NOT_STARTED GD +\. + + +-- +-- TOC entry 3607 (class 0 OID 17241) +-- Dependencies: 260 +-- Data for Name: event_groups; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.event_groups (event_id, groups_id) FROM stdin; +21 22 +21 23 +22 24 +22 25 +23 26 +24 27 +25 28 +26 29 +28 30 +30 31 +\. + + +-- +-- TOC entry 3610 (class 0 OID 17282) +-- Dependencies: 263 +-- Data for Name: event_registrations; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.event_registrations (event_id, registrations_id) FROM stdin; +28 675 +28 679 +28 684 +28 677 +28 672 +28 671 +28 669 +28 870 +30 681 +30 683 +30 685 +30 678 +30 673 +30 871 +40 1095 +40 1096 +40 1097 +40 1098 +40 1099 +40 1100 +40 1101 +40 1102 +40 1103 +40 1104 +40 1105 +40 1106 +40 1107 +40 1108 +40 1109 +40 1110 +40 1111 +40 1112 +40 1113 +40 1114 +40 1115 +40 1116 +40 1117 +40 1118 +23 624 +23 622 +23 621 +23 620 +23 619 +23 618 +23 617 +23 616 +23 615 +23 614 +23 613 +23 612 +23 611 +23 667 +26 674 +26 670 +26 668 +26 676 +27 680 +27 682 +39 1077 +39 1078 +39 1079 +39 1080 +39 1081 +39 1082 +39 1083 +39 1084 +39 1085 +39 1086 +39 1087 +39 1088 +39 1089 +39 1090 +39 1091 +39 1092 +39 1093 +39 1094 +21 577 +21 576 +21 575 +21 574 +21 573 +21 572 +21 571 +21 570 +21 569 +21 568 +21 567 +21 566 +21 565 +21 564 +21 563 +21 562 +21 561 +21 560 +21 559 +21 558 +21 557 +21 556 +21 555 +21 554 +21 553 +21 552 +21 551 +21 550 +21 549 +21 548 +21 578 +25 664 +25 662 +25 660 +25 658 +25 656 +25 654 +25 652 +25 650 +25 648 +25 646 +25 644 +25 665 +25 663 +25 661 +25 659 +25 657 +25 655 +25 653 +25 651 +25 649 +25 647 +25 645 +25 643 +25 666 +22 609 +22 608 +22 607 +22 606 +22 605 +22 604 +22 603 +22 602 +22 601 +22 600 +22 599 +22 598 +22 597 +22 596 +22 595 +22 594 +22 593 +22 592 +22 591 +22 590 +22 589 +22 588 +22 587 +22 586 +22 585 +22 584 +22 583 +22 582 +22 581 +22 580 +22 579 +22 610 +24 641 +24 640 +24 639 +24 638 +24 637 +24 636 +24 635 +24 634 +24 633 +24 632 +24 631 +24 630 +24 629 +24 628 +24 627 +24 626 +24 625 +24 642 +32 786 +32 687 +32 694 +32 695 +32 696 +32 697 +32 698 +32 699 +32 700 +32 701 +32 702 +32 703 +32 704 +32 705 +32 706 +32 707 +32 708 +32 709 +32 710 +32 711 +32 712 +32 713 +32 714 +32 715 +32 716 +32 717 +32 718 +32 719 +32 720 +32 721 +32 722 +32 723 +32 724 +32 725 +32 757 +32 758 +32 759 +32 760 +32 761 +32 762 +32 763 +32 764 +32 765 +32 766 +32 767 +32 768 +32 769 +32 770 +32 771 +32 772 +32 773 +32 774 +32 775 +32 776 +32 777 +32 778 +32 779 +32 780 +32 781 +32 782 +32 783 +32 784 +32 785 +32 787 +32 788 +31 686 +31 688 +31 689 +31 690 +31 691 +31 692 +31 693 +31 726 +31 727 +31 728 +31 729 +31 730 +31 731 +31 732 +31 733 +31 734 +31 735 +31 736 +31 737 +31 738 +31 739 +31 740 +31 741 +31 742 +31 743 +31 744 +31 745 +31 746 +31 747 +31 748 +31 749 +31 750 +31 751 +31 752 +31 753 +31 754 +31 755 +31 756 +31 789 +31 790 +31 791 +31 792 +31 793 +31 794 +31 795 +31 796 +31 797 +31 798 +31 799 +31 800 +31 801 +31 802 +31 803 +31 804 +31 805 +31 806 +31 807 +31 808 +31 809 +31 810 +31 811 +31 812 +31 813 +33 826 +33 824 +33 825 +33 822 +33 823 +33 820 +33 821 +33 818 +33 819 +33 816 +33 817 +33 814 +33 815 +33 827 +34 844 +34 842 +34 843 +34 840 +34 841 +34 838 +34 839 +34 836 +34 837 +34 834 +34 835 +34 832 +34 833 +34 830 +34 831 +34 828 +34 829 +34 845 +35 867 +35 865 +35 863 +35 861 +35 859 +35 857 +35 855 +35 853 +35 851 +35 849 +35 847 +35 868 +35 866 +35 864 +35 862 +35 860 +35 858 +35 856 +35 854 +35 852 +35 850 +35 848 +35 846 +35 869 +36 1044 +36 1043 +36 1027 +36 1026 +36 1025 +36 1024 +36 1023 +36 1022 +36 1021 +36 1020 +36 1019 +36 1018 +36 1017 +36 1016 +36 1015 +36 1014 +36 1013 +36 1012 +36 1011 +36 1010 +36 1009 +36 1008 +36 1007 +36 1006 +36 1005 +36 1004 +36 1003 +36 1002 +36 1001 +36 1000 +36 999 +36 966 +36 965 +36 964 +36 963 +36 962 +36 961 +36 960 +36 959 +36 958 +36 957 +36 956 +36 955 +36 954 +36 953 +36 952 +36 951 +36 950 +36 949 +36 948 +36 947 +36 946 +36 945 +36 944 +36 943 +36 942 +36 941 +36 940 +36 939 +36 938 +36 937 +36 936 +36 935 +36 934 +36 933 +36 932 +36 931 +36 930 +36 929 +36 928 +36 927 +36 926 +36 925 +36 924 +36 923 +36 922 +36 921 +36 920 +36 919 +36 918 +36 917 +36 916 +36 915 +36 914 +36 913 +36 912 +36 879 +36 878 +36 877 +36 876 +36 875 +36 874 +36 872 +36 1045 +37 1061 +37 1060 +37 1059 +37 1058 +37 1057 +37 1056 +37 1055 +37 1054 +37 1053 +37 1052 +37 1051 +37 1050 +37 1049 +37 1048 +37 1047 +37 1046 +37 1042 +37 1041 +37 1040 +37 1039 +37 1038 +37 1037 +37 1036 +37 1035 +37 1034 +37 1033 +37 1032 +37 1031 +37 1030 +37 1029 +37 1028 +37 998 +37 997 +37 996 +37 995 +37 994 +37 993 +37 992 +37 991 +37 990 +37 989 +37 988 +37 987 +37 986 +37 985 +37 984 +37 983 +37 982 +37 981 +37 980 +37 979 +37 978 +37 977 +37 976 +37 975 +37 974 +37 973 +37 972 +37 971 +37 970 +37 969 +37 968 +37 967 +37 911 +37 910 +37 909 +37 908 +37 907 +37 906 +37 905 +37 904 +37 903 +37 902 +37 901 +37 900 +37 899 +37 898 +37 897 +37 896 +37 895 +37 894 +37 893 +37 892 +37 891 +37 890 +37 889 +37 888 +37 887 +37 886 +37 885 +37 884 +37 883 +37 882 +37 881 +37 880 +37 873 +37 1062 +38 1075 +38 1074 +38 1073 +38 1072 +38 1071 +38 1070 +38 1069 +38 1068 +38 1067 +38 1066 +38 1065 +38 1064 +38 1063 +38 1076 +\. + + +-- +-- TOC entry 3606 (class 0 OID 17227) +-- Dependencies: 259 +-- Data for Name: eventgroup; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.eventgroup (type, event_id, id, name, status) FROM stdin; +0 \N 8 Herenenkel 1 IN_PROGRESS +0 \N 9 Herenenkel 2 IN_PROGRESS +1 \N 10 Damesenkel 1 IN_PROGRESS +1 \N 11 Damesenkel 2 IN_PROGRESS +0 \N 15 Herenenkel 1 IN_PROGRESS +0 \N 16 Herenenkel 2 IN_PROGRESS +1 \N 17 Damesenkel 1 IN_PROGRESS +1 \N 18 Damesenkel 2 IN_PROGRESS +2 23 19 Herendubbel IN_PROGRESS +3 24 20 Damesdubbel IN_PROGRESS +4 25 21 Gemengd dubbel IN_PROGRESS +0 \N 22 Herenenkel 1 IN_PROGRESS +0 \N 23 Herenenkel 2 IN_PROGRESS +1 \N 24 Damesenkel 1 IN_PROGRESS +1 \N 25 Damesenkel 2 IN_PROGRESS +2 23 26 Herendubbel IN_PROGRESS +3 24 27 Damesdubbel IN_PROGRESS +4 25 28 Gemengd dubbel IN_PROGRESS +0 26 29 Herenenkel IN_PROGRESS +2 28 30 Herendubbel IN_PROGRESS +4 30 31 Gemengd dubbel IN_PROGRESS +\. + + +-- +-- TOC entry 3618 (class 0 OID 17380) +-- Dependencies: 271 +-- Data for Name: eventgroup_rounds; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.eventgroup_rounds (group_id, rounds_id) FROM stdin; +8 1 +10 3 +11 4 +22 15 +23 16 +24 17 +25 18 +26 19 +27 20 +28 21 +\. + + +-- +-- TOC entry 3615 (class 0 OID 17348) +-- Dependencies: 268 +-- Data for Name: eventgroup_teams; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.eventgroup_teams (group_id, teams_id) FROM stdin; +15 246 +15 247 +15 248 +15 249 +15 250 +15 251 +15 252 +15 253 +15 254 +15 255 +15 256 +15 257 +15 258 +15 259 +15 260 +15 261 +16 262 +16 263 +16 264 +16 265 +16 266 +16 267 +16 268 +16 269 +16 270 +16 271 +16 272 +16 273 +16 274 +16 275 +16 276 +17 277 +17 278 +17 279 +17 280 +17 281 +17 282 +17 283 +17 284 +17 285 +17 286 +17 287 +17 288 +17 289 +17 290 +17 291 +17 292 +18 293 +18 294 +18 295 +18 296 +18 297 +18 298 +18 299 +18 300 +18 301 +18 302 +18 303 +18 304 +18 305 +18 306 +18 307 +18 308 +19 309 +19 310 +19 311 +19 312 +19 313 +19 314 +19 315 +20 316 +20 317 +20 318 +20 319 +20 320 +20 321 +20 322 +20 323 +20 324 +21 325 +21 326 +21 327 +21 328 +21 329 +21 330 +21 331 +21 332 +21 333 +21 334 +21 335 +21 336 +22 337 +22 338 +22 339 +22 340 +22 341 +22 342 +22 343 +22 344 +22 345 +22 346 +22 347 +22 348 +22 349 +22 350 +22 351 +22 352 +23 353 +23 354 +23 355 +23 356 +23 357 +23 358 +23 359 +23 360 +23 361 +23 362 +23 363 +23 364 +23 365 +23 366 +23 367 +24 368 +24 369 +24 370 +24 371 +24 372 +24 373 +24 374 +24 375 +24 376 +24 377 +24 378 +24 379 +24 380 +24 381 +24 382 +24 383 +25 384 +25 385 +25 386 +25 387 +25 388 +25 389 +25 390 +25 391 +25 392 +25 393 +25 394 +25 395 +25 396 +25 397 +25 398 +25 399 +26 400 +26 401 +26 402 +26 403 +26 404 +26 405 +26 406 +27 407 +27 408 +27 409 +27 410 +27 411 +27 412 +27 413 +27 414 +27 415 +28 416 +28 417 +28 418 +28 419 +28 420 +28 421 +28 422 +28 423 +28 424 +28 425 +28 426 +28 427 +29 428 +29 429 +29 430 +29 431 +30 432 +30 433 +30 434 +30 435 +30 436 +31 437 +31 438 +31 439 +31 440 +\. + + +-- +-- TOC entry 3598 (class 0 OID 17183) +-- Dependencies: 251 +-- Data for Name: flyway_schema_history; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.flyway_schema_history (installed_rank, version, description, type, script, checksum, installed_by, installed_on, execution_time, success) FROM stdin; +1 1 init SQL V1__init.sql 2080519899 swiss-user 2024-10-03 10:35:39.763959 127 t +\. + + +-- +-- TOC entry 3622 (class 0 OID 17419) +-- Dependencies: 275 +-- Data for Name: game; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.game (id, match_id, score1, score2) FROM stdin; +\. + + +-- +-- TOC entry 3620 (class 0 OID 17396) +-- Dependencies: 273 +-- Data for Name: match; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.match (played, status, type, court, end_time, id, round_id, start_time, team1_id, team2_id) FROM stdin; +f 0 0 \N \N 45 8 \N 346 345 +f 0 0 \N \N 46 8 \N 347 350 +f 0 0 \N \N 47 8 \N 348 337 +f 0 0 \N \N 48 8 \N 343 352 +f 0 0 \N \N 49 8 \N 342 344 +f 0 0 \N \N 50 8 \N 339 340 +f 0 0 \N \N 51 8 \N 338 351 +f 0 0 \N \N 52 8 \N 341 349 +f 0 0 \N \N 53 9 \N 361 360 +f 0 0 \N \N 54 9 \N 367 358 +f 0 0 \N \N 55 9 \N 363 362 +f 0 0 \N \N 56 9 \N 364 354 +f 0 0 \N \N 57 9 \N 365 357 +f 0 0 \N \N 58 9 \N 366 356 +f 0 0 \N \N 59 9 \N 355 353 +f 0 1 \N \N 60 10 \N 378 375 +f 0 1 \N \N 61 10 \N 369 376 +f 0 1 \N \N 62 10 \N 379 372 +f 0 1 \N \N 63 10 \N 371 381 +f 0 1 \N \N 64 10 \N 382 373 +f 0 1 \N \N 65 10 \N 380 383 +f 0 1 \N \N 66 10 \N 370 374 +f 0 1 \N \N 67 10 \N 368 377 +f 0 1 \N \N 68 11 \N 399 389 +f 0 1 \N \N 69 11 \N 396 391 +f 0 1 \N \N 70 11 \N 384 385 +f 0 1 \N \N 71 11 \N 386 397 +f 0 1 \N \N 72 11 \N 388 387 +f 0 1 \N \N 73 11 \N 395 392 +f 0 1 \N \N 74 11 \N 390 394 +f 0 1 \N \N 75 11 \N 398 393 +f 0 2 \N \N 76 12 \N 401 402 +f 0 2 \N \N 77 12 \N 400 403 +f 0 2 \N \N 78 12 \N 405 406 +f 0 3 \N \N 79 13 \N 408 412 +f 0 3 \N \N 80 13 \N 410 407 +f 0 3 \N \N 81 13 \N 413 414 +f 0 3 \N \N 82 13 \N 415 409 +f 0 4 \N \N 83 14 \N 427 426 +f 0 4 \N \N 84 14 \N 416 423 +f 0 4 \N \N 85 14 \N 421 424 +f 0 4 \N \N 86 14 \N 422 425 +f 0 4 \N \N 87 14 \N 418 417 +f 0 4 \N \N 88 14 \N 420 419 +f 0 0 \N \N 89 15 \N 344 348 +f 0 0 \N \N 90 15 \N 345 343 +f 0 0 \N \N 91 15 \N 342 347 +f 0 0 \N \N 92 15 \N 340 349 +f 0 0 \N \N 93 15 \N 341 346 +f 0 0 \N \N 94 15 \N 337 352 +f 0 0 \N \N 95 15 \N 351 350 +f 0 0 \N \N 96 15 \N 339 338 +f 0 0 \N \N 97 16 \N 356 360 +f 0 0 \N \N 98 16 \N 361 364 +f 0 0 \N \N 99 16 \N 357 358 +f 0 0 \N \N 100 16 \N 365 367 +f 0 0 \N \N 101 16 \N 354 359 +f 0 0 \N \N 102 16 \N 362 366 +f 0 0 \N \N 103 16 \N 355 363 +f 0 1 \N \N 104 17 \N 368 371 +f 0 1 \N \N 105 17 \N 370 372 +f 0 1 \N \N 106 17 \N 380 382 +f 0 1 \N \N 107 17 \N 369 381 +f 0 1 \N \N 108 17 \N 377 374 +f 0 1 \N \N 109 17 \N 383 379 +f 0 1 \N \N 110 17 \N 373 375 +f 0 1 \N \N 111 17 \N 376 378 +f 0 1 \N \N 112 18 \N 385 384 +f 0 1 \N \N 113 18 \N 397 394 +f 0 1 \N \N 114 18 \N 398 396 +f 0 1 \N \N 115 18 \N 389 395 +f 0 1 \N \N 116 18 \N 387 391 +f 0 1 \N \N 117 18 \N 392 393 +f 0 1 \N \N 118 18 \N 390 388 +f 0 1 \N \N 119 18 \N 386 399 +f 0 2 \N \N 120 19 \N 400 406 +f 0 2 \N \N 121 19 \N 401 402 +f 0 2 \N \N 122 19 \N 405 403 +f 0 3 \N \N 123 20 \N 414 408 +f 0 3 \N \N 124 20 \N 413 411 +f 0 3 \N \N 125 20 \N 415 412 +f 0 3 \N \N 126 20 \N 409 410 +f 0 4 \N \N 127 21 \N 416 421 +f 0 4 \N \N 128 21 \N 422 417 +f 0 4 \N \N 129 21 \N 420 425 +f 0 4 \N \N 130 21 \N 426 418 +f 0 4 \N \N 131 21 \N 423 419 +f 0 4 \N \N 132 21 \N 424 427 +\. + + +-- +-- TOC entry 3623 (class 0 OID 17429) +-- Dependencies: 276 +-- Data for Name: match_games; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.match_games (games_id, match_id) FROM stdin; +\. + + +-- +-- TOC entry 3600 (class 0 OID 17193) +-- Dependencies: 253 +-- Data for Name: player; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.player (birthday, id, club, email, first_name, last_name, middle_name, phone_number, sex, strength) FROM stdin; +0101-05-12 316 BCH bch1@bch.nl bch1 bch1 \N 0612345678 M D7 +0101-05-12 317 BCH bch1@bch.nl tess koemans \N 0612345678 V D6 +1999-09-23 322 ELO United aaaa@bbb.cc Jeffrey Rakhorst \N 0612345678 M D8 +2006-11-05 331 ZBC aaaa@bbb.cc Guido Keizer \N 0612345678 M DR +1963-05-07 340 WSV Apeldoorn aaaa@bbb.cc Gerben Duursma \N 0612345678 M D7 +2009-05-31 346 BC Kwiek aaaa@bbb.cc Gert Keizer \N 0612345678 M D7 +1955-06-15 347 BC Holten aaaa@bbb.cc Dennis Ebbers \N 0612345678 M D9 +1957-08-04 348 BC Holten aaaa@bbb.cc Pieter Verschoor \N 0612345678 M D5 +2000-09-01 349 Flits aaaa@bbb.cc Amber Ebbers \N 0612345678 V D7 +1950-05-19 350 ELO United aaaa@bbb.cc Lisa Koers \N 0612345678 V D7 +1950-01-02 351 BC Kwiek aaaa@bbb.cc Vanja Koers \N 0612345678 V DR +1967-03-08 352 BC Holten aaaa@bbb.cc Evelien Lensink \N 0612345678 V D5 +1955-09-13 353 BC Kwiek aaaa@bbb.cc Daphne Rakhorst \N 0612345678 V D6 +2001-02-03 354 BC Holten aaaa@bbb.cc Willemijn Goedhart \N 0612345678 V D9 +1955-07-08 355 BC IJsselstad aaaa@bbb.cc Miranda Rakhorst \N 0612345678 V D9 +2000-09-03 356 BC Holten aaaa@bbb.cc Inge Brehler \N 0612345678 V D7 +1973-07-15 357 BC IJsselstad aaaa@bbb.cc Esmee Ebbers \N 0612345678 V D8 +1964-10-17 358 Flits aaaa@bbb.cc Joanne Verschoor \N 0612345678 V D7 +1984-08-18 359 Flits aaaa@bbb.cc Laura Koers \N 0612345678 V D5 +1975-03-24 360 BC IJsselstad aaaa@bbb.cc Nienke Coemans \N 0612345678 V D9 +1999-11-14 361 BC IJsselstad aaaa@bbb.cc Patty Brehler \N 0612345678 V D7 +2001-05-02 362 BC Holten aaaa@bbb.cc Rosan Kelder \N 0612345678 V D8 +1958-08-18 363 BC IJsselstad aaaa@bbb.cc Vera Keizer \N 0612345678 V DR +1973-12-27 364 ZBC aaaa@bbb.cc Hedwig Koers \N 0612345678 V D5 +2008-02-08 365 BC Kwiek aaaa@bbb.cc Lois Gijsman \N 0612345678 V DR +1968-02-29 366 ZBC aaaa@bbb.cc Liedewij Lups \N 0612345678 V D6 +1967-12-05 367 Flits aaaa@bbb.cc Gera Castelein \N 0612345678 V D6 +1959-08-28 368 ELO United aaaa@bbb.cc Carolien Seinen \N 0612345678 V D6 +2005-02-20 369 BC Holten aaaa@bbb.cc Anne Rakhorst \N 0612345678 V D9 +1972-05-23 370 Flits aaaa@bbb.cc Dominique Zijlma \N 0612345678 V DR +1970-01-20 371 BC Reflex aaaa@bbb.cc Linda Mulder \N 0612345678 V D8 +1999-07-01 372 BC Kwiek aaaa@bbb.cc Esther Verschoor \N 0612345678 V D7 +1953-08-28 373 WSV Apeldoorn aaaa@bbb.cc Marilyn Mayer \N 0612345678 V D8 +1955-07-13 374 BC Holten aaaa@bbb.cc Ilse Westerik \N 0612345678 V DR +2001-02-18 375 ELO United aaaa@bbb.cc Emily Stein \N 0612345678 V D8 +1965-10-27 376 Flits aaaa@bbb.cc Eva Coemans \N 0612345678 V D7 +2006-11-13 377 Flits aaaa@bbb.cc Kitty Ebbers \N 0612345678 V DR +1981-06-07 378 BC IJsselstad aaaa@bbb.cc Floor Rakhorst \N 0612345678 V D8 +1978-09-10 379 Flits aaaa@bbb.cc Tess Huijbers \N 0612345678 V D9 +1984-06-10 380 BC Holten aaaa@bbb.cc Fenna Brugman \N 0612345678 V D7 +1999-01-17 381 BC Kwiek aaaa@bbb.cc Michel Rakhorst \N 0612345678 M D7 +1979-02-09 382 WSV Apeldoorn aaaa@bbb.cc Eric Gijsman \N 0612345678 M D7 +1956-11-28 383 BC IJsselstad aaaa@bbb.cc Leon Duursma \N 0612345678 M DR +2001-01-10 384 BC IJsselstad aaaa@bbb.cc Luuk Lups \N 0612345678 M D5 +2007-01-14 385 ELO United aaaa@bbb.cc Jeffrey Seinen \N 0612345678 M D8 +1999-05-21 386 BC Holten aaaa@bbb.cc Jason Mulder \N 0612345678 M D5 +1994-01-09 387 WSV Apeldoorn aaaa@bbb.cc Oleg Rakhorst \N 0612345678 M D9 +2002-10-19 388 BC Holten aaaa@bbb.cc Gerjan Coemans \N 0612345678 M D7 +1985-10-24 389 ZBC aaaa@bbb.cc Gerard Mulder \N 0612345678 M D5 +2003-11-04 390 BC Reflex aaaa@bbb.cc Henk Lensink \N 0612345678 M D8 +1988-09-25 391 BC Reflex aaaa@bbb.cc Peter Kelder \N 0612345678 M D8 +1972-06-06 392 BC Reflex aaaa@bbb.cc Gerrit Kelder \N 0612345678 M DR +1953-11-18 393 BC Kwiek aaaa@bbb.cc Wilco Lensink \N 0612345678 M D9 +1958-05-29 394 ELO United aaaa@bbb.cc Guido Huijbers \N 0612345678 M D7 +2003-09-06 395 ZBC aaaa@bbb.cc Sander Lups \N 0612345678 M DR +1977-07-06 396 ELO United aaaa@bbb.cc Roy Verschoor \N 0612345678 M D7 +1950-05-07 397 ZBC aaaa@bbb.cc Yafiq Mayer \N 0612345678 M D7 +1982-10-05 398 ELO United aaaa@bbb.cc Martijn Koers \N 0612345678 M D7 +1973-06-22 399 ZBC aaaa@bbb.cc Dick Koers \N 0612345678 M D7 +1975-07-02 400 ZBC aaaa@bbb.cc Willem Coemans \N 0612345678 M D7 +1985-06-25 401 ELO United aaaa@bbb.cc Layo Kelder \N 0612345678 M D7 +1977-02-03 402 BC IJsselstad aaaa@bbb.cc Thomas Goedhart \N 0612345678 M D9 +1990-01-09 403 BC Kwiek aaaa@bbb.cc Gerben Castelein \N 0612345678 M D5 +1965-10-26 253 BC Kwiek aaaa@bbb.cc Michel Zijlma \N 0612345678 M D6 +1954-04-18 254 BC Holten aaaa@bbb.cc Eric Mulder \N 0612345678 M D9 +2004-04-23 255 WSV Apeldoorn aaaa@bbb.cc Leon Holstege \N 0612345678 M D7 +1950-12-22 256 BC Kwiek aaaa@bbb.cc Luuk Castelein \N 0612345678 M D7 +1973-11-24 257 ELO United aaaa@bbb.cc Jeffrey Brehler \N 0612345678 M D8 +1974-05-19 258 BC IJsselstad aaaa@bbb.cc Jason Lups \N 0612345678 M D9 +1982-05-12 259 BC IJsselstad aaaa@bbb.cc Oleg Seinen \N 0612345678 M D6 +2002-03-20 260 BC Reflex aaaa@bbb.cc Gerjan Seinen \N 0612345678 M D9 +1950-06-23 261 ELO United aaaa@bbb.cc Gerard Stein \N 0612345678 M D6 +1962-08-17 262 ZBC aaaa@bbb.cc Henk Keizer \N 0612345678 M D8 +1968-04-23 263 BC Kwiek aaaa@bbb.cc Peter Seinen \N 0612345678 M D9 +1974-09-20 264 ELO United aaaa@bbb.cc Gerrit Jansen \N 0612345678 M DR +1985-04-23 404 ZBC aaaa@bbb.cc Bert Kingma \N 0612345678 M D8 +1968-08-24 265 BC IJsselstad aaaa@bbb.cc Wilco Rakhorst \N 0612345678 M DR +1951-10-13 266 BC Reflex aaaa@bbb.cc Guido Koers \N 0612345678 M D7 +1960-07-20 267 ELO United aaaa@bbb.cc Sander Duursma \N 0612345678 M DR +1976-06-27 268 ZBC aaaa@bbb.cc Roy Huijbers \N 0612345678 M DR +1998-08-21 269 ZBC aaaa@bbb.cc Yafiq Keizer \N 0612345678 M D8 +1984-10-01 270 BC Reflex aaaa@bbb.cc Martijn Huijbers \N 0612345678 M D7 +1969-05-01 271 BC Kwiek aaaa@bbb.cc Dick Mulder \N 0612345678 M D5 +1980-02-17 272 Flits aaaa@bbb.cc Willem Ebbers \N 0612345678 M D9 +1969-09-26 273 WSV Apeldoorn aaaa@bbb.cc Layo Stein \N 0612345678 M D6 +1962-08-20 274 BC Reflex aaaa@bbb.cc Thomas Goedhart \N 0612345678 M D6 +2002-02-21 275 ELO United aaaa@bbb.cc Gerben Duindam \N 0612345678 M DR +1963-08-19 276 BC Reflex aaaa@bbb.cc Bert Lups \N 0612345678 M D6 +2004-10-27 277 ELO United aaaa@bbb.cc Bart Mulder \N 0612345678 M D5 +1999-03-02 278 BC Kwiek aaaa@bbb.cc Nico Holstege \N 0612345678 M D7 +1976-04-23 279 ELO United aaaa@bbb.cc Jan Rakhorst \N 0612345678 M D9 +1978-05-19 280 Flits aaaa@bbb.cc Diederik Holstege \N 0612345678 M D8 +1969-02-12 281 Flits aaaa@bbb.cc Gert Ebbers \N 0612345678 M DR +1951-09-09 282 WSV Apeldoorn aaaa@bbb.cc Dennis Holstege \N 0612345678 M DR +1961-01-17 283 BC Reflex aaaa@bbb.cc Pieter Duindam \N 0612345678 M D6 +1991-04-16 284 ELO United aaaa@bbb.cc Amber Westerik \N 0612345678 V D8 +1956-01-18 285 ZBC aaaa@bbb.cc Lisa Coemans \N 0612345678 V D8 +1977-10-22 286 WSV Apeldoorn aaaa@bbb.cc Vanja Stein \N 0612345678 V D7 +1965-12-24 287 Flits aaaa@bbb.cc Evelien Verschoor \N 0612345678 V D6 +1991-06-04 288 ELO United aaaa@bbb.cc Daphne Zijlma \N 0612345678 V DR +1981-04-20 289 BC Reflex aaaa@bbb.cc Willemijn Huijbers \N 0612345678 V D7 +1960-10-05 290 ELO United aaaa@bbb.cc Miranda Duursma \N 0612345678 V D8 +1960-05-22 291 WSV Apeldoorn aaaa@bbb.cc Inge Mulder \N 0612345678 V D7 +1966-08-01 292 BC Reflex aaaa@bbb.cc Esmee Keizer \N 0612345678 V DR +1959-05-21 293 BC IJsselstad aaaa@bbb.cc Joanne Jansen \N 0612345678 V D7 +1966-05-08 294 BC IJsselstad aaaa@bbb.cc Laura Lups \N 0612345678 V D7 +1986-04-29 295 BC Kwiek aaaa@bbb.cc Nienke Castelein \N 0612345678 V D8 +1958-08-24 296 ELO United aaaa@bbb.cc Patty Verschoor \N 0612345678 V D9 +1972-07-24 297 BC Reflex aaaa@bbb.cc Rosan Coemans \N 0612345678 V DR +2007-11-15 298 BC IJsselstad aaaa@bbb.cc Vera Koers \N 0612345678 V D8 +1961-05-01 299 WSV Apeldoorn aaaa@bbb.cc Hedwig Huijbers \N 0612345678 V D7 +1995-11-04 300 WSV Apeldoorn aaaa@bbb.cc Lois Lensink \N 0612345678 V D7 +1971-11-21 301 BC IJsselstad aaaa@bbb.cc Liedewij Brugman \N 0612345678 V D9 +1980-03-29 302 WSV Apeldoorn aaaa@bbb.cc Gera Kingma \N 0612345678 V D6 +1999-04-15 303 BC Kwiek aaaa@bbb.cc Carolien Huijbers \N 0612345678 V D6 +1996-07-28 304 BC IJsselstad aaaa@bbb.cc Anne Meedendorp \N 0612345678 V D7 +1956-01-09 305 BC Holten aaaa@bbb.cc Dominique Brugman \N 0612345678 V D6 +1963-10-29 306 BC IJsselstad aaaa@bbb.cc Linda Mayer \N 0612345678 V D8 +1959-09-01 307 BC Holten aaaa@bbb.cc Esther Jansen \N 0612345678 V DR +1996-01-15 308 ELO United aaaa@bbb.cc Marilyn Westerik \N 0612345678 V D9 +1992-12-12 309 ELO United aaaa@bbb.cc Ilse Kingma \N 0612345678 V DR +1969-02-02 310 WSV Apeldoorn aaaa@bbb.cc Emily Keizer \N 0612345678 V D8 +1981-01-26 311 BC IJsselstad aaaa@bbb.cc Eva Mulder \N 0612345678 V D5 +1952-07-29 312 BC Holten aaaa@bbb.cc Kitty Lups \N 0612345678 V D6 +1952-07-08 313 BC Kwiek aaaa@bbb.cc Floor Kingma \N 0612345678 V D6 +1962-01-27 314 BC IJsselstad aaaa@bbb.cc Tess Coemans \N 0612345678 V D6 +1966-03-30 315 ELO United aaaa@bbb.cc Fenna Kingma \N 0612345678 V DR +1970-02-09 318 ZBC aaaa@bbb.cc Michel Seinen \N 0612345678 M D9 +1968-01-26 319 WSV Apeldoorn aaaa@bbb.cc Eric Goedhart \N 0612345678 M D7 +1964-08-01 320 BC Reflex aaaa@bbb.cc Leon Jansen \N 0612345678 M D8 +1981-05-26 321 BC Kwiek aaaa@bbb.cc Luuk Mayer \N 0612345678 M D7 +1958-07-10 323 ZBC aaaa@bbb.cc Jason Holstege \N 0612345678 M D6 +1977-04-14 324 Flits aaaa@bbb.cc Oleg Meedendorp \N 0612345678 M D7 +1993-06-23 325 BC Holten aaaa@bbb.cc Gerjan Mulder \N 0612345678 M D7 +1951-06-07 326 Flits aaaa@bbb.cc Gerard Duindam \N 0612345678 M D7 +1951-11-08 327 ELO United aaaa@bbb.cc Henk Meedendorp \N 0612345678 M D6 +1978-03-19 328 BC Reflex aaaa@bbb.cc Peter Castelein \N 0612345678 M D7 +1986-05-15 329 BC IJsselstad aaaa@bbb.cc Gerrit Brugman \N 0612345678 M DR +1985-01-10 330 Flits aaaa@bbb.cc Wilco Meedendorp \N 0612345678 M DR +1984-05-09 332 ZBC aaaa@bbb.cc Sander Goedhart \N 0612345678 M D6 +1969-10-28 333 ZBC aaaa@bbb.cc Roy Huijbers \N 0612345678 M D9 +1951-05-29 334 ELO United aaaa@bbb.cc Yafiq Goedhart \N 0612345678 M D5 +1964-03-11 335 BC Holten aaaa@bbb.cc Martijn Stein \N 0612345678 M D7 +1992-08-31 336 WSV Apeldoorn aaaa@bbb.cc Dick Duursma \N 0612345678 M DR +1961-03-11 337 BC Reflex aaaa@bbb.cc Willem Mulder \N 0612345678 M D7 +1993-05-14 338 ZBC aaaa@bbb.cc Layo Lensink \N 0612345678 M D5 +1978-03-16 339 ELO United aaaa@bbb.cc Thomas Kingma \N 0612345678 M D8 +1954-12-17 341 ZBC aaaa@bbb.cc Bert Westerik \N 0612345678 M D5 +1970-01-19 342 Flits aaaa@bbb.cc Bart Lensink \N 0612345678 M D9 +1994-08-24 343 WSV Apeldoorn aaaa@bbb.cc Nico Castelein \N 0612345678 M D6 +1961-10-09 344 ZBC aaaa@bbb.cc Jan Mulder \N 0612345678 M D7 +2005-12-04 345 BC Kwiek aaaa@bbb.cc Diederik Duindam \N 0612345678 M D9 +1968-07-30 405 BC Holten aaaa@bbb.cc Bart Jansen \N 0612345678 M D6 +1960-07-23 407 BC Holten aaaa@bbb.cc Jan Castelein \N 0612345678 M DR +2004-03-11 408 WSV Apeldoorn aaaa@bbb.cc Diederik Mayer \N 0612345678 M D7 +1993-06-19 411 BC Holten aaaa@bbb.cc Pieter Verboom \N 0612345678 M D8 +1986-05-27 414 BC Kwiek aaaa@bbb.cc Vanja Huijbers \N 0612345678 V D8 +1969-02-20 416 BC Holten aaaa@bbb.cc Daphne Mulder \N 0612345678 V D8 +1988-11-18 417 BC Holten aaaa@bbb.cc Willemijn Mulder \N 0612345678 V D7 +1980-04-06 418 ZBC aaaa@bbb.cc Miranda Mulder \N 0612345678 V DR +1996-06-05 419 BC IJsselstad aaaa@bbb.cc Inge Westerik \N 0612345678 V D6 +1969-12-25 422 ELO United aaaa@bbb.cc Laura Verboom \N 0612345678 V D7 +1999-12-25 425 Flits aaaa@bbb.cc Rosan Ebbers \N 0612345678 V D6 +1976-09-27 427 ZBC aaaa@bbb.cc Hedwig Stein \N 0612345678 V D7 +1997-08-12 428 ZBC aaaa@bbb.cc Lois Brugman \N 0612345678 V D6 +1994-09-19 431 BC Kwiek aaaa@bbb.cc Carolien Verschoor \N 0612345678 V D6 +1990-04-19 434 WSV Apeldoorn aaaa@bbb.cc Linda Brehler \N 0612345678 V D5 +1978-06-01 436 Flits aaaa@bbb.cc Marilyn Lups \N 0612345678 V DR +2002-01-15 437 BC Holten aaaa@bbb.cc Ilse Koers \N 0612345678 V D5 +2005-06-09 440 BC Reflex aaaa@bbb.cc Kitty Westerik \N 0612345678 V D7 +2004-04-04 443 BC Reflex aaaa@bbb.cc Fenna Meedendorp \N 0612345678 V D7 +1970-06-23 406 ZBC aaaa@bbb.cc Nico Castelein \N 0612345678 M D8 +2004-05-12 409 BC Holten aaaa@bbb.cc Gert Castelein \N 0612345678 M D8 +1960-03-24 410 BC Kwiek aaaa@bbb.cc Dennis Goedhart \N 0612345678 M D7 +1975-05-08 415 ZBC aaaa@bbb.cc Evelien Verschoor \N 0612345678 V D6 +1992-05-03 420 BC Holten aaaa@bbb.cc Esmee Mulder \N 0612345678 V D8 +1961-01-17 421 BC Holten aaaa@bbb.cc Joanne Brugman \N 0612345678 V D8 +1960-03-31 426 BC Reflex aaaa@bbb.cc Vera Zijlma \N 0612345678 V D6 +1971-02-24 429 WSV Apeldoorn aaaa@bbb.cc Liedewij Stein \N 0612345678 V D7 +1968-06-14 430 WSV Apeldoorn aaaa@bbb.cc Gera Lups \N 0612345678 V D6 +1958-03-29 435 BC Kwiek aaaa@bbb.cc Esther Mayer \N 0612345678 V D9 +1969-07-31 438 WSV Apeldoorn aaaa@bbb.cc Emily Seinen \N 0612345678 V D9 +1960-05-06 439 ELO United aaaa@bbb.cc Eva Ebbers \N 0612345678 V D6 +1977-04-28 412 BC Reflex aaaa@bbb.cc Amber Duindam \N 0612345678 V D6 +1986-11-09 413 BC Reflex aaaa@bbb.cc Lisa Stein \N 0612345678 V D5 +1991-07-30 423 BC Holten aaaa@bbb.cc Nienke Zijlma \N 0612345678 V D9 +1994-07-11 424 BC Kwiek aaaa@bbb.cc Patty Stein \N 0612345678 V D6 +2001-06-18 432 ELO United aaaa@bbb.cc Anne Keizer \N 0612345678 V D9 +1994-03-23 433 BC Reflex aaaa@bbb.cc Dominique Brehler \N 0612345678 V D9 +1994-04-17 441 ELO United aaaa@bbb.cc Floor Keizer \N 0612345678 V D9 +1972-12-08 442 Flits aaaa@bbb.cc Tess Kelder \N 0612345678 V D7 +\. + + +-- +-- TOC entry 3611 (class 0 OID 17297) +-- Dependencies: 264 +-- Data for Name: player_partner_registrations; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.player_partner_registrations (partner_registrations_id, player_id) FROM stdin; +\. + + +-- +-- TOC entry 3612 (class 0 OID 17312) +-- Dependencies: 265 +-- Data for Name: player_registrations; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.player_registrations (player_id, registrations_id) FROM stdin; +\. + + +-- +-- TOC entry 3609 (class 0 OID 17257) +-- Dependencies: 262 +-- Data for Name: registration; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.registration (event_id, id, partner_id, player_id, tournament_id) FROM stdin; +21 548 \N 253 5 +21 549 \N 254 5 +21 550 \N 255 5 +21 551 \N 256 5 +21 552 \N 257 5 +21 553 \N 258 5 +21 554 \N 259 5 +21 555 \N 260 5 +21 556 \N 261 5 +21 557 \N 262 5 +21 558 \N 263 5 +21 559 \N 264 5 +21 560 \N 265 5 +21 561 \N 266 5 +21 562 \N 267 5 +21 563 \N 268 5 +21 564 \N 269 5 +21 565 \N 270 5 +21 566 \N 271 5 +21 567 \N 272 5 +21 568 \N 273 5 +21 569 \N 274 5 +21 570 \N 275 5 +21 571 \N 276 5 +21 572 \N 277 5 +21 573 \N 278 5 +21 574 \N 279 5 +21 575 \N 280 5 +21 576 \N 281 5 +21 577 \N 282 5 +21 578 \N 283 5 +22 579 \N 284 5 +22 580 \N 285 5 +22 581 \N 286 5 +22 582 \N 287 5 +22 583 \N 288 5 +22 584 \N 289 5 +22 585 \N 290 5 +22 586 \N 291 5 +22 587 \N 292 5 +22 588 \N 293 5 +22 589 \N 294 5 +22 590 \N 295 5 +22 591 \N 296 5 +22 592 \N 297 5 +22 593 \N 298 5 +22 594 \N 299 5 +22 595 \N 300 5 +22 596 \N 301 5 +22 597 \N 302 5 +22 598 \N 303 5 +22 599 \N 304 5 +22 600 \N 305 5 +22 601 \N 306 5 +22 602 \N 307 5 +22 603 \N 308 5 +22 604 \N 309 5 +22 605 \N 310 5 +22 606 \N 311 5 +22 607 \N 312 5 +22 608 \N 313 5 +22 609 \N 314 5 +22 610 \N 315 5 +23 611 254 253 5 +23 612 253 254 5 +23 613 256 255 5 +23 614 255 256 5 +23 615 258 257 5 +23 616 257 258 5 +23 617 260 259 5 +23 618 259 260 5 +23 619 262 261 5 +23 620 261 262 5 +23 621 264 263 5 +23 622 263 264 5 +23 623 266 265 5 +23 624 265 266 5 +24 625 285 284 5 +24 626 284 285 5 +24 627 287 286 5 +24 628 286 287 5 +24 629 289 288 5 +24 630 288 289 5 +24 631 291 290 5 +24 632 290 291 5 +24 633 293 292 5 +24 634 292 293 5 +24 635 295 294 5 +24 636 294 295 5 +24 637 297 296 5 +24 638 296 297 5 +24 639 299 298 5 +24 640 298 299 5 +24 641 301 300 5 +24 642 300 301 5 +25 643 302 271 5 +25 644 271 302 5 +25 645 303 272 5 +25 646 272 303 5 +25 647 304 273 5 +25 648 273 304 5 +25 649 305 274 5 +25 650 274 305 5 +25 651 306 275 5 +25 652 275 306 5 +25 653 307 276 5 +25 654 276 307 5 +25 655 308 277 5 +25 656 277 308 5 +25 657 309 278 5 +25 658 278 309 5 +25 659 310 279 5 +25 660 279 310 5 +25 661 311 280 5 +25 662 280 311 5 +25 663 312 281 5 +25 664 281 312 5 +25 665 313 282 5 +25 666 282 313 5 +23 667 266 265 5 +26 668 \N 316 6 +28 669 253 316 6 +26 670 \N 253 6 +28 671 316 253 6 +30 673 284 254 6 +32 786 \N 313 7 +28 672 265 254 6 +26 674 \N 265 6 +28 675 254 265 6 +26 676 \N 261 6 +28 677 262 259 6 +30 678 287 259 6 +28 679 259 262 6 +27 680 \N 287 6 +30 681 259 287 6 +27 682 \N 284 6 +30 683 254 284 6 +28 684 276 260 6 +30 685 299 260 6 +31 686 \N 316 7 +32 687 \N 317 7 +31 688 \N 322 7 +31 689 \N 331 7 +31 690 \N 340 7 +31 691 \N 346 7 +31 692 \N 347 7 +31 693 \N 348 7 +32 694 \N 349 7 +32 695 \N 350 7 +32 696 \N 351 7 +32 697 \N 352 7 +32 698 \N 353 7 +32 699 \N 354 7 +32 700 \N 355 7 +32 701 \N 356 7 +32 702 \N 357 7 +32 703 \N 358 7 +32 704 \N 359 7 +32 705 \N 360 7 +32 706 \N 361 7 +32 707 \N 362 7 +32 708 \N 363 7 +32 709 \N 364 7 +32 710 \N 365 7 +32 711 \N 366 7 +32 712 \N 367 7 +32 713 \N 368 7 +32 714 \N 369 7 +32 715 \N 370 7 +32 716 \N 371 7 +32 717 \N 372 7 +32 718 \N 373 7 +32 719 \N 374 7 +32 720 \N 375 7 +32 721 \N 376 7 +32 722 \N 377 7 +32 723 \N 378 7 +32 724 \N 379 7 +32 725 \N 380 7 +31 726 \N 253 7 +31 727 \N 254 7 +31 728 \N 255 7 +31 729 \N 256 7 +31 730 \N 257 7 +31 731 \N 258 7 +31 732 \N 259 7 +31 733 \N 260 7 +31 734 \N 261 7 +31 735 \N 262 7 +31 736 \N 263 7 +31 737 \N 264 7 +31 738 \N 265 7 +31 739 \N 266 7 +31 740 \N 267 7 +31 741 \N 268 7 +31 742 \N 269 7 +31 743 \N 270 7 +31 744 \N 271 7 +31 745 \N 272 7 +31 746 \N 273 7 +31 747 \N 274 7 +31 748 \N 275 7 +31 749 \N 276 7 +31 750 \N 277 7 +31 751 \N 278 7 +31 752 \N 279 7 +31 753 \N 280 7 +31 754 \N 281 7 +31 755 \N 282 7 +31 756 \N 283 7 +32 757 \N 284 7 +32 758 \N 285 7 +32 759 \N 286 7 +32 760 \N 287 7 +32 761 \N 288 7 +32 762 \N 289 7 +32 763 \N 290 7 +32 764 \N 291 7 +32 765 \N 292 7 +32 766 \N 293 7 +32 767 \N 294 7 +32 768 \N 295 7 +32 769 \N 296 7 +32 770 \N 297 7 +32 771 \N 298 7 +32 772 \N 299 7 +32 773 \N 300 7 +32 774 \N 301 7 +32 775 \N 302 7 +32 776 \N 303 7 +32 777 \N 304 7 +32 778 \N 305 7 +32 779 \N 306 7 +32 780 \N 307 7 +32 781 \N 308 7 +32 782 \N 309 7 +32 783 \N 310 7 +32 784 \N 311 7 +32 785 \N 312 7 +32 787 \N 314 7 +32 788 \N 315 7 +31 789 \N 318 7 +31 790 \N 319 7 +31 791 \N 320 7 +31 792 \N 321 7 +31 793 \N 323 7 +31 794 \N 324 7 +31 795 \N 325 7 +31 796 \N 326 7 +31 797 \N 327 7 +31 798 \N 328 7 +31 799 \N 329 7 +31 800 \N 330 7 +31 801 \N 332 7 +31 802 \N 333 7 +31 803 \N 334 7 +31 804 \N 335 7 +31 805 \N 336 7 +31 806 \N 337 7 +31 807 \N 338 7 +31 808 \N 339 7 +31 809 \N 341 7 +31 810 \N 342 7 +33 814 322 316 7 +33 815 316 322 7 +33 816 340 331 7 +33 817 331 340 7 +33 818 347 346 7 +33 819 346 347 7 +33 820 253 348 7 +33 821 348 253 7 +33 822 255 254 7 +33 824 257 256 7 +33 825 256 257 7 +33 826 259 258 7 +33 827 258 259 7 +34 828 349 317 7 +34 829 317 349 7 +34 830 351 350 7 +34 831 350 351 7 +34 832 353 352 7 +34 833 352 353 7 +34 834 355 354 7 +34 835 354 355 7 +34 837 356 357 7 +34 838 359 358 7 +34 839 358 359 7 +34 840 361 360 7 +34 841 360 361 7 +34 842 363 362 7 +34 843 362 363 7 +34 844 365 364 7 +34 845 364 365 7 +35 846 366 264 7 +35 847 264 366 7 +35 849 265 367 7 +35 850 368 266 7 +35 851 266 368 7 +35 852 369 267 7 +35 853 267 369 7 +35 854 370 268 7 +35 855 268 370 7 +35 856 371 269 7 +35 857 269 371 7 +35 858 372 270 7 +35 859 270 372 7 +35 860 373 271 7 +35 861 271 373 7 +35 862 374 272 7 +35 863 272 374 7 +35 865 273 375 7 +35 866 376 274 7 +35 867 274 376 7 +35 868 377 275 7 +35 869 275 377 7 +31 811 \N 343 7 +31 812 \N 344 7 +31 813 \N 345 7 +33 823 254 255 7 +34 836 357 356 7 +35 848 367 265 7 +35 864 375 273 7 +28 870 263 276 6 +30 871 \N 276 6 +36 872 \N 316 8 +37 873 \N 317 8 +36 874 \N 322 8 +36 875 \N 331 8 +36 876 \N 340 8 +36 877 \N 346 8 +36 878 \N 347 8 +36 879 \N 348 8 +37 880 \N 349 8 +37 881 \N 350 8 +37 882 \N 351 8 +37 883 \N 352 8 +37 884 \N 353 8 +37 885 \N 354 8 +37 886 \N 355 8 +37 887 \N 356 8 +37 888 \N 357 8 +37 889 \N 358 8 +37 890 \N 359 8 +37 891 \N 360 8 +37 892 \N 361 8 +37 893 \N 362 8 +37 894 \N 363 8 +37 895 \N 364 8 +37 896 \N 365 8 +37 897 \N 366 8 +37 898 \N 367 8 +37 899 \N 368 8 +37 900 \N 369 8 +37 901 \N 370 8 +37 902 \N 371 8 +37 903 \N 372 8 +37 904 \N 373 8 +37 905 \N 374 8 +37 906 \N 375 8 +37 907 \N 376 8 +37 908 \N 377 8 +37 909 \N 378 8 +37 910 \N 379 8 +37 911 \N 380 8 +36 912 \N 381 8 +36 913 \N 382 8 +36 914 \N 383 8 +36 915 \N 384 8 +36 916 \N 385 8 +36 917 \N 386 8 +36 918 \N 387 8 +36 919 \N 388 8 +36 920 \N 389 8 +36 921 \N 390 8 +36 922 \N 391 8 +36 923 \N 392 8 +36 924 \N 393 8 +36 925 \N 394 8 +36 926 \N 395 8 +36 927 \N 396 8 +36 928 \N 397 8 +36 929 \N 398 8 +36 930 \N 399 8 +36 931 \N 400 8 +36 932 \N 401 8 +36 933 \N 402 8 +36 934 \N 403 8 +36 935 \N 253 8 +36 936 \N 254 8 +36 937 \N 255 8 +36 938 \N 256 8 +36 939 \N 257 8 +36 940 \N 258 8 +36 941 \N 259 8 +36 942 \N 260 8 +36 943 \N 261 8 +36 944 \N 262 8 +36 945 \N 263 8 +36 946 \N 264 8 +36 947 \N 404 8 +36 948 \N 265 8 +36 949 \N 266 8 +36 950 \N 267 8 +36 951 \N 268 8 +36 952 \N 269 8 +36 953 \N 270 8 +36 954 \N 271 8 +36 955 \N 272 8 +36 956 \N 273 8 +36 957 \N 274 8 +36 958 \N 275 8 +36 959 \N 276 8 +36 960 \N 277 8 +36 961 \N 278 8 +36 962 \N 279 8 +36 963 \N 280 8 +36 964 \N 281 8 +36 965 \N 282 8 +36 966 \N 283 8 +37 967 \N 284 8 +37 968 \N 285 8 +37 969 \N 286 8 +37 970 \N 287 8 +37 971 \N 288 8 +37 972 \N 289 8 +37 973 \N 290 8 +37 974 \N 291 8 +37 975 \N 292 8 +37 976 \N 293 8 +37 977 \N 294 8 +37 978 \N 295 8 +37 979 \N 296 8 +37 980 \N 297 8 +37 981 \N 298 8 +37 982 \N 299 8 +37 983 \N 300 8 +37 984 \N 301 8 +37 985 \N 302 8 +37 986 \N 303 8 +37 987 \N 304 8 +37 988 \N 305 8 +37 989 \N 306 8 +37 990 \N 307 8 +37 991 \N 308 8 +37 992 \N 309 8 +37 993 \N 310 8 +37 994 \N 311 8 +37 995 \N 312 8 +37 996 \N 313 8 +37 997 \N 314 8 +37 998 \N 315 8 +36 999 \N 318 8 +36 1002 \N 321 8 +36 1004 \N 324 8 +36 1005 \N 325 8 +36 1006 \N 326 8 +36 1007 \N 327 8 +36 1008 \N 328 8 +36 1011 \N 332 8 +36 1013 \N 334 8 +36 1014 \N 335 8 +36 1015 \N 336 8 +36 1016 \N 337 8 +36 1017 \N 338 8 +36 1018 \N 339 8 +36 1021 \N 343 8 +36 1023 \N 345 8 +36 1024 \N 405 8 +36 1025 \N 407 8 +36 1026 \N 408 8 +36 1027 \N 411 8 +37 1030 \N 417 8 +37 1032 \N 419 8 +37 1033 \N 422 8 +37 1034 \N 425 8 +37 1035 \N 427 8 +37 1036 \N 428 8 +37 1040 \N 437 8 +36 1043 \N 406 8 +36 1044 \N 409 8 +36 1045 \N 410 8 +37 1046 \N 415 8 +37 1047 \N 420 8 +37 1050 \N 429 8 +37 1052 \N 435 8 +37 1053 \N 438 8 +37 1054 \N 439 8 +37 1055 \N 412 8 +37 1056 \N 413 8 +37 1059 \N 432 8 +37 1061 \N 441 8 +37 1062 \N 442 8 +38 1063 322 316 8 +38 1064 316 322 8 +38 1067 347 346 8 +38 1068 346 347 8 +38 1072 382 383 8 +38 1073 385 384 8 +38 1074 384 385 8 +38 1075 387 386 8 +38 1076 386 387 8 +36 1000 \N 319 8 +36 1009 \N 329 8 +36 1019 \N 341 8 +37 1028 \N 414 8 +37 1037 \N 431 8 +37 1048 \N 421 8 +37 1057 \N 423 8 +38 1065 340 331 8 +39 1077 349 317 8 +36 1001 \N 320 8 +36 1003 \N 323 8 +36 1010 \N 330 8 +36 1012 \N 333 8 +36 1020 \N 342 8 +36 1022 \N 344 8 +37 1029 \N 416 8 +37 1031 \N 418 8 +37 1038 \N 434 8 +37 1039 \N 436 8 +37 1041 \N 440 8 +37 1042 \N 443 8 +37 1049 \N 426 8 +37 1051 \N 430 8 +37 1058 \N 424 8 +37 1060 \N 433 8 +38 1066 331 340 8 +38 1069 381 348 8 +38 1070 348 381 8 +38 1071 383 382 8 +39 1078 317 349 8 +39 1079 351 350 8 +39 1080 350 351 8 +39 1081 353 352 8 +39 1082 352 353 8 +39 1083 355 354 8 +39 1084 354 355 8 +39 1085 357 356 8 +39 1086 356 357 8 +39 1087 359 358 8 +39 1088 358 359 8 +39 1089 361 360 8 +39 1090 360 361 8 +39 1091 363 362 8 +39 1092 362 363 8 +39 1093 365 364 8 +39 1094 364 365 8 +40 1095 366 392 8 +40 1096 392 366 8 +40 1097 367 393 8 +40 1098 393 367 8 +40 1099 368 394 8 +40 1100 394 368 8 +40 1101 369 395 8 +40 1102 395 369 8 +40 1103 370 396 8 +40 1104 396 370 8 +40 1105 371 397 8 +40 1106 397 371 8 +40 1107 372 398 8 +40 1108 398 372 8 +40 1109 373 399 8 +40 1110 399 373 8 +40 1111 374 400 8 +40 1112 400 374 8 +40 1113 375 401 8 +40 1114 401 375 8 +40 1115 376 402 8 +40 1116 402 376 8 +40 1117 377 403 8 +40 1118 403 377 8 +\. + + +-- +-- TOC entry 3617 (class 0 OID 17364) +-- Dependencies: 270 +-- Data for Name: round; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.round (status, drawn_out_id, group_id, id, name) FROM stdin; +0 \N 10 3 Ronde 1 +0 \N 11 4 Ronde 1 +2 \N 8 1 Ronde 1 +0 \N 22 8 Ronde 1 +0 359 23 9 Ronde 1 +0 \N 24 10 Ronde 1 +0 \N 25 11 Ronde 1 +0 404 26 12 Ronde 1 +0 411 27 13 Ronde 1 +0 \N 28 14 Ronde 1 +0 353 23 16 Ronde 1 +0 \N 24 17 Ronde 1 +0 \N 25 18 Ronde 1 +0 404 26 19 Ronde 1 +0 407 27 20 Ronde 1 +0 \N 28 21 Ronde 1 +2 \N 22 15 Ronde 1 +\. + + +-- +-- TOC entry 3624 (class 0 OID 17444) +-- Dependencies: 277 +-- Data for Name: round_matches; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.round_matches (matches_id, round_id) FROM stdin; +45 8 +46 8 +47 8 +48 8 +49 8 +50 8 +51 8 +52 8 +53 9 +54 9 +55 9 +56 9 +57 9 +58 9 +59 9 +60 10 +61 10 +62 10 +63 10 +64 10 +65 10 +66 10 +67 10 +68 11 +69 11 +70 11 +71 11 +72 11 +73 11 +74 11 +75 11 +76 12 +77 12 +78 12 +79 13 +80 13 +81 13 +82 13 +83 14 +84 14 +85 14 +86 14 +87 14 +88 14 +89 15 +90 15 +91 15 +92 15 +93 15 +94 15 +95 15 +96 15 +97 16 +98 16 +99 16 +100 16 +101 16 +102 16 +103 16 +104 17 +105 17 +106 17 +107 17 +108 17 +109 17 +110 17 +111 17 +112 18 +113 18 +114 18 +115 18 +116 18 +117 18 +118 18 +119 18 +120 19 +121 19 +122 19 +123 20 +124 20 +125 20 +126 20 +127 21 +128 21 +129 21 +130 21 +131 21 +132 21 +\. + + +-- +-- TOC entry 3625 (class 0 OID 17459) +-- Dependencies: 278 +-- Data for Name: round_quit; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.round_quit (quit_id, round_id) FROM stdin; +\. + + +-- +-- TOC entry 3614 (class 0 OID 17328) +-- Dependencies: 267 +-- Data for Name: team; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.team (group_id, id, player1_id, player2_id) FROM stdin; +15 246 277 \N +15 247 283 \N +15 248 276 \N +15 249 261 \N +15 250 273 \N +15 251 266 \N +15 252 255 \N +15 253 280 \N +15 254 257 \N +15 255 272 \N +15 256 263 \N +15 257 258 \N +15 258 281 \N +15 259 268 \N +15 260 275 \N +15 261 265 \N +16 262 271 \N +16 263 259 \N +16 264 274 \N +16 265 253 \N +16 266 270 \N +16 267 278 \N +16 268 256 \N +16 269 269 \N +16 270 262 \N +16 271 279 \N +16 272 254 \N +16 273 260 \N +16 274 282 \N +16 275 264 \N +16 276 267 \N +17 277 311 \N +17 278 313 \N +17 279 302 \N +17 280 305 \N +17 281 300 \N +17 282 291 \N +17 283 294 \N +17 284 289 \N +17 285 310 \N +17 286 285 \N +17 287 295 \N +17 288 306 \N +17 289 308 \N +17 290 315 \N +17 291 288 \N +17 292 292 \N +18 293 314 \N +18 294 312 \N +18 295 287 \N +18 296 303 \N +18 297 293 \N +18 298 286 \N +18 299 304 \N +18 300 299 \N +18 301 284 \N +18 302 298 \N +18 303 290 \N +18 304 301 \N +18 305 296 \N +18 306 297 \N +18 307 309 \N +18 308 307 \N +19 309 266 265 +19 310 264 263 +19 311 262 261 +19 312 260 259 +19 313 258 257 +19 314 256 255 +19 315 254 253 +20 316 301 300 +20 317 299 298 +20 318 297 296 +20 319 295 294 +20 320 293 292 +20 321 291 290 +20 322 289 288 +20 323 287 286 +20 324 285 284 +21 325 313 282 +21 326 312 281 +21 327 311 280 +21 328 310 279 +21 329 309 278 +21 330 308 277 +21 331 307 276 +21 332 306 275 +21 333 305 274 +21 334 304 273 +21 335 303 272 +21 336 302 271 +22 337 271 \N +22 338 283 \N +22 339 253 \N +22 340 274 \N +22 341 259 \N +22 342 266 \N +22 343 278 \N +22 344 280 \N +22 345 269 \N +22 346 263 \N +22 347 254 \N +22 348 279 \N +22 349 281 \N +22 350 268 \N +22 351 267 \N +22 352 265 \N +23 353 277 \N +23 354 261 \N +23 355 276 \N +23 356 273 \N +23 357 256 \N +23 358 255 \N +23 359 270 \N +23 360 257 \N +23 361 262 \N +23 362 260 \N +23 363 272 \N +23 364 258 \N +23 365 282 \N +23 366 264 \N +23 367 275 \N +24 368 311 \N +24 369 314 \N +24 370 287 \N +24 371 302 \N +24 372 291 \N +24 373 289 \N +24 374 300 \N +24 375 304 \N +24 376 290 \N +24 377 284 \N +24 378 285 \N +24 379 298 \N +24 380 301 \N +24 381 315 \N +24 382 288 \N +24 383 297 \N +25 384 313 \N +25 385 312 \N +25 386 303 \N +25 387 305 \N +25 388 294 \N +25 389 286 \N +25 390 299 \N +25 391 293 \N +25 392 310 \N +25 393 295 \N +25 394 306 \N +25 395 308 \N +25 396 296 \N +25 397 309 \N +25 398 307 \N +25 399 292 \N +26 400 266 265 +26 401 264 263 +26 402 262 261 +26 403 260 259 +26 404 258 257 +26 405 256 255 +26 406 254 253 +27 407 301 300 +27 408 299 298 +27 409 297 296 +27 410 295 294 +27 411 293 292 +27 412 291 290 +27 413 289 288 +27 414 287 286 +27 415 285 284 +28 416 313 282 +28 417 312 281 +28 418 311 280 +28 419 310 279 +28 420 309 278 +28 421 308 277 +28 422 307 276 +28 423 306 275 +28 424 305 274 +28 425 304 273 +28 426 303 272 +28 427 302 271 +29 428 265 \N +29 429 261 \N +29 430 253 \N +29 431 316 \N +30 432 276 263 +30 433 265 254 +30 434 262 259 +30 435 260 276 +30 436 253 316 +31 437 287 259 +31 438 284 254 +31 439 276 \N +31 440 260 299 +\. + + +-- +-- TOC entry 3602 (class 0 OID 17203) +-- Dependencies: 255 +-- Data for Name: tournament; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.tournament (date, courts, id, max_events, name, status) FROM stdin; +2024-12-14 9 7 2 Testtoernooi UPCOMING +2023-12-14 6 5 2 Testtoernooi ONGOING +2024-12-14 6 6 2 test 14 december DIVIDED +2024-12-14 9 8 2 Testtoernooi UPCOMING +\. + + +-- +-- TOC entry 3626 (class 0 OID 17474) +-- Dependencies: 279 +-- Data for Name: tournament_costs_per_event; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.tournament_costs_per_event (costs_per_event, tournament_id) FROM stdin; +10 6 +20 6 +0 6 +6 7 +10 7 +0 7 +6 5 +10 5 +0 5 +6 8 +10 8 +0 8 +\. + + +-- +-- TOC entry 3627 (class 0 OID 17482) +-- Dependencies: 280 +-- Data for Name: tournament_events; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.tournament_events (events_id, tournament_id) FROM stdin; +21 5 +22 5 +23 5 +24 5 +25 5 +26 6 +27 6 +28 6 +29 6 +30 6 +31 7 +32 7 +33 7 +34 7 +35 7 +36 8 +37 8 +38 8 +39 8 +40 8 +\. + + +-- +-- TOC entry 3629 (class 0 OID 17498) +-- Dependencies: 282 +-- Data for Name: tournament_player; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.tournament_player (paid, present, id, player_id, tournament_id) FROM stdin; +f f 64 263 5 +f f 65 253 5 +f f 66 254 5 +f f 67 272 5 +f f 68 293 5 +f f 69 264 5 +f f 70 283 5 +f f 71 256 5 +f f 72 313 5 +f f 73 259 5 +f f 74 261 5 +f f 75 314 5 +f f 76 298 5 +f f 77 295 5 +f f 78 301 5 +f f 79 281 5 +f f 80 300 5 +f f 81 304 5 +f f 82 265 5 +f f 83 258 5 +f f 84 277 5 +f f 85 297 5 +f f 86 299 5 +f f 87 306 5 +f f 88 291 5 +f f 89 280 5 +f f 90 262 5 +f f 91 282 5 +f f 92 292 5 +f f 93 289 5 +f f 94 284 5 +f f 95 288 5 +f f 96 303 5 +f f 97 266 5 +f f 98 285 5 +f f 99 267 5 +f f 100 287 5 +f f 101 305 5 +f f 102 309 5 +f f 103 255 5 +f f 104 275 5 +f f 105 296 5 +f f 106 302 5 +f f 107 290 5 +f f 108 279 5 +f f 109 268 5 +f f 110 269 5 +f f 111 271 5 +f f 112 278 5 +f f 113 260 5 +f f 114 276 5 +f f 115 310 5 +f f 116 257 5 +f f 117 270 5 +f f 118 273 5 +f f 119 286 5 +f f 120 311 5 +f f 121 308 5 +f f 122 294 5 +f f 123 274 5 +f f 124 315 5 +f f 125 312 5 +f f 126 307 5 +f f 127 259 5 +f f 128 271 5 +f f 129 283 5 +f f 130 313 5 +f f 131 290 5 +f f 132 253 5 +f f 133 288 5 +f f 134 306 5 +f f 135 267 5 +f f 136 257 5 +f f 137 264 5 +f f 138 314 5 +f f 139 286 5 +f f 140 305 5 +f f 141 293 5 +f f 142 311 5 +f f 143 300 5 +f f 144 308 5 +f f 145 310 5 +f f 146 282 5 +f f 147 315 5 +f f 148 301 5 +f f 149 274 5 +f f 150 265 5 +f f 151 302 5 +f f 152 260 5 +f f 153 266 5 +f f 154 278 5 +f f 155 268 5 +f f 156 258 5 +f f 157 279 5 +f f 158 277 5 +f f 159 294 5 +f f 160 303 5 +f f 161 281 5 +f f 162 280 5 +f f 163 269 5 +f f 164 284 5 +f f 165 309 5 +f f 166 304 5 +f f 167 261 5 +f f 168 273 5 +f f 169 262 5 +f f 170 295 5 +f f 171 307 5 +f f 172 272 5 +f f 173 263 5 +f f 174 296 5 +f f 175 275 5 +f f 176 289 5 +f f 177 285 5 +f f 178 298 5 +f f 179 292 5 +f f 180 256 5 +f f 181 255 5 +f f 182 254 5 +f f 183 276 5 +f f 184 287 5 +f f 185 299 5 +f f 186 270 5 +f f 187 291 5 +f f 188 297 5 +f f 189 312 5 +\. + + +-- +-- TOC entry 3631 (class 0 OID 17528) +-- Dependencies: 284 +-- Data for Name: tournament_player_events; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.tournament_player_events (tournament_player_id, events) FROM stdin; +64 HE +64 HD +65 HE +65 HD +66 HE +66 HD +67 HE +67 GD +68 DE +68 DD +69 HE +69 HD +70 HE +71 HE +71 HD +72 DE +72 GD +73 HE +73 HD +74 HE +74 HD +75 DE +76 DE +76 DD +77 DE +77 DD +78 DE +78 DD +79 HE +79 GD +80 DE +80 DD +81 DE +81 GD +82 HE +82 HD +83 HE +83 HD +84 HE +84 GD +85 DE +85 DD +86 DE +86 DD +87 DE +87 GD +88 DE +88 DD +89 HE +89 GD +90 HE +90 HD +91 HE +91 GD +92 DE +92 DD +93 DE +93 DD +94 DE +94 DD +95 DE +95 DD +96 DE +96 GD +97 HE +97 HD +98 DE +98 DD +99 HE +100 DE +100 DD +101 DE +101 GD +102 DE +102 GD +103 HE +103 HD +104 HE +104 GD +105 DE +105 DD +106 DE +106 GD +107 DE +107 DD +108 HE +108 GD +109 HE +110 HE +111 HE +111 GD +112 HE +112 GD +113 HE +113 HD +114 HE +114 GD +115 DE +115 GD +116 HE +116 HD +117 HE +118 HE +118 GD +119 DE +119 DD +120 DE +120 GD +121 DE +121 GD +122 DE +122 DD +123 HE +123 GD +124 DE +125 DE +125 GD +126 DE +126 GD +127 HE +127 HD +128 HE +128 GD +129 HE +130 DE +130 GD +131 DE +131 DD +132 HE +132 HD +133 DE +133 DD +134 DE +134 GD +135 HE +136 HE +136 HD +137 HE +137 HD +138 DE +139 DE +139 DD +140 DE +140 GD +141 DE +141 DD +142 DE +142 GD +143 DE +143 DD +144 DE +144 GD +145 DE +145 GD +146 HE +146 GD +147 DE +148 DE +148 DD +149 HE +149 GD +150 HE +150 HD +151 DE +151 GD +152 HE +152 HD +153 HE +153 HD +154 HE +154 GD +155 HE +156 HE +156 HD +157 HE +157 GD +158 HE +158 GD +159 DE +159 DD +160 DE +160 GD +161 HE +161 GD +162 HE +162 GD +163 HE +164 DE +164 DD +165 DE +165 GD +166 DE +166 GD +167 HE +167 HD +168 HE +168 GD +169 HE +169 HD +170 DE +170 DD +171 DE +171 GD +172 HE +172 GD +173 HE +173 HD +174 DE +174 DD +175 HE +175 GD +176 DE +176 DD +177 DE +177 DD +178 DE +178 DD +179 DE +179 DD +180 HE +180 HD +181 HE +181 HD +182 HE +182 HD +183 HE +183 GD +184 DE +184 DD +185 DE +185 DD +186 HE +187 DE +187 DD +188 DE +188 DD +189 DE +189 GD +\. + + +-- +-- TOC entry 3630 (class 0 OID 17513) +-- Dependencies: 283 +-- Data for Name: tournament_tournament_players; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +COPY swiss.tournament_tournament_players (tournament_id, tournament_players_id) FROM stdin; +5 136 +5 140 +5 148 +5 180 +5 170 +5 177 +5 188 +5 138 +5 175 +5 129 +5 131 +5 135 +5 161 +5 172 +5 149 +5 146 +5 162 +5 181 +5 154 +5 160 +5 185 +5 186 +5 155 +5 176 +5 171 +5 137 +5 141 +5 145 +5 179 +5 169 +5 163 +5 147 +5 130 +5 151 +5 165 +5 153 +5 178 +5 143 +5 183 +5 156 +5 189 +5 159 +5 134 +5 166 +5 158 +5 128 +5 182 +5 142 +5 187 +5 157 +5 150 +5 152 +5 127 +5 173 +5 167 +5 168 +5 139 +5 184 +5 174 +5 164 +5 144 +5 133 +5 132 +\. + + +-- +-- TOC entry 3637 (class 0 OID 0) +-- Dependencies: 256 +-- Name: event_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.event_id_seq', 40, true); + + +-- +-- TOC entry 3638 (class 0 OID 0) +-- Dependencies: 258 +-- Name: eventgroup_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.eventgroup_id_seq', 31, true); + + +-- +-- TOC entry 3639 (class 0 OID 0) +-- Dependencies: 274 +-- Name: game_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.game_id_seq', 1, false); + + +-- +-- TOC entry 3640 (class 0 OID 0) +-- Dependencies: 272 +-- Name: match_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.match_id_seq', 132, true); + + +-- +-- TOC entry 3641 (class 0 OID 0) +-- Dependencies: 252 +-- Name: player_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.player_id_seq', 443, true); + + +-- +-- TOC entry 3642 (class 0 OID 0) +-- Dependencies: 261 +-- Name: registration_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.registration_id_seq', 1118, true); + + +-- +-- TOC entry 3643 (class 0 OID 0) +-- Dependencies: 269 +-- Name: round_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.round_id_seq', 21, true); + + +-- +-- TOC entry 3644 (class 0 OID 0) +-- Dependencies: 266 +-- Name: team_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.team_id_seq', 440, true); + + +-- +-- TOC entry 3645 (class 0 OID 0) +-- Dependencies: 254 +-- Name: tournament_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.tournament_id_seq', 8, true); + + +-- +-- TOC entry 3646 (class 0 OID 0) +-- Dependencies: 281 +-- Name: tournament_player_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.tournament_player_id_seq', 189, true); + + +-- +-- TOC entry 3381 (class 2606 OID 17245) +-- Name: event_groups event_groups_groups_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_groups + ADD CONSTRAINT event_groups_groups_id_key UNIQUE (groups_id); + + +-- +-- TOC entry 3377 (class 2606 OID 17220) +-- Name: event event_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event + ADD CONSTRAINT event_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3385 (class 2606 OID 17286) +-- Name: event_registrations event_registrations_registrations_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_registrations + ADD CONSTRAINT event_registrations_registrations_id_key UNIQUE (registrations_id); + + +-- +-- TOC entry 3379 (class 2606 OID 17235) +-- Name: eventgroup eventgroup_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup + ADD CONSTRAINT eventgroup_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3397 (class 2606 OID 17384) +-- Name: eventgroup_rounds eventgroup_rounds_rounds_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_rounds + ADD CONSTRAINT eventgroup_rounds_rounds_id_key UNIQUE (rounds_id); + + +-- +-- TOC entry 3393 (class 2606 OID 17352) +-- Name: eventgroup_teams eventgroup_teams_teams_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_teams + ADD CONSTRAINT eventgroup_teams_teams_id_key UNIQUE (teams_id); + + +-- +-- TOC entry 3370 (class 2606 OID 17190) +-- Name: flyway_schema_history flyway_schema_history_pk; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.flyway_schema_history + ADD CONSTRAINT flyway_schema_history_pk PRIMARY KEY (installed_rank); + + +-- +-- TOC entry 3401 (class 2606 OID 17423) +-- Name: game game_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.game + ADD CONSTRAINT game_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3403 (class 2606 OID 17433) +-- Name: match_games match_games_games_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match_games + ADD CONSTRAINT match_games_games_id_key UNIQUE (games_id); + + +-- +-- TOC entry 3399 (class 2606 OID 17402) +-- Name: match match_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT match_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3387 (class 2606 OID 17301) +-- Name: player_partner_registrations player_partner_registrations_partner_registrations_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_partner_registrations + ADD CONSTRAINT player_partner_registrations_partner_registrations_id_key UNIQUE (partner_registrations_id); + + +-- +-- TOC entry 3373 (class 2606 OID 17201) +-- Name: player player_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player + ADD CONSTRAINT player_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3389 (class 2606 OID 17316) +-- Name: player_registrations player_registrations_registrations_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_registrations + ADD CONSTRAINT player_registrations_registrations_id_key UNIQUE (registrations_id); + + +-- +-- TOC entry 3383 (class 2606 OID 17261) +-- Name: registration registration_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT registration_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3405 (class 2606 OID 17448) +-- Name: round_matches round_matches_matches_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_matches + ADD CONSTRAINT round_matches_matches_id_key UNIQUE (matches_id); + + +-- +-- TOC entry 3395 (class 2606 OID 17369) +-- Name: round round_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round + ADD CONSTRAINT round_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3407 (class 2606 OID 17463) +-- Name: round_quit round_quit_quit_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_quit + ADD CONSTRAINT round_quit_quit_id_key UNIQUE (quit_id); + + +-- +-- TOC entry 3391 (class 2606 OID 17332) +-- Name: team team_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT team_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3409 (class 2606 OID 17486) +-- Name: tournament_events tournament_events_events_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_events + ADD CONSTRAINT tournament_events_events_id_key UNIQUE (events_id); + + +-- +-- TOC entry 3375 (class 2606 OID 17210) +-- Name: tournament tournament_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament + ADD CONSTRAINT tournament_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3411 (class 2606 OID 17502) +-- Name: tournament_player tournament_player_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player + ADD CONSTRAINT tournament_player_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3413 (class 2606 OID 17517) +-- Name: tournament_tournament_players tournament_tournament_players_tournament_players_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_tournament_players + ADD CONSTRAINT tournament_tournament_players_tournament_players_id_key UNIQUE (tournament_players_id); + + +-- +-- TOC entry 3371 (class 1259 OID 17191) +-- Name: flyway_schema_history_s_idx; Type: INDEX; Schema: swiss; Owner: swiss-user +-- + +CREATE INDEX flyway_schema_history_s_idx ON swiss.flyway_schema_history USING btree (success); + + +-- +-- TOC entry 3431 (class 2606 OID 17353) +-- Name: eventgroup_teams fk2o8i34jh5bk79ya6pc8w3k9of; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_teams + ADD CONSTRAINT fk2o8i34jh5bk79ya6pc8w3k9of FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3433 (class 2606 OID 17370) +-- Name: round fk3w19bu9yiv9px837huabw6abs; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round + ADD CONSTRAINT fk3w19bu9yiv9px837huabw6abs FOREIGN KEY (drawn_out_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3434 (class 2606 OID 17375) +-- Name: round fk3ytfpp2rat10y2x43g7cl61p3; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round + ADD CONSTRAINT fk3ytfpp2rat10y2x43g7cl61p3 FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3424 (class 2606 OID 17307) +-- Name: player_partner_registrations fk61ldsgn3vwru4tjdiraxrsaeb; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_partner_registrations + ADD CONSTRAINT fk61ldsgn3vwru4tjdiraxrsaeb FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3428 (class 2606 OID 17333) +-- Name: team fk6sh9ago3tae2l8og75kbrf4mx; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT fk6sh9ago3tae2l8og75kbrf4mx FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3432 (class 2606 OID 17358) +-- Name: eventgroup_teams fk832tg34v55x5kuma6ia55w4dq; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_teams + ADD CONSTRAINT fk832tg34v55x5kuma6ia55w4dq FOREIGN KEY (teams_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3429 (class 2606 OID 17343) +-- Name: team fk962rmngjyud0ijcw4w7d9vfs0; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT fk962rmngjyud0ijcw4w7d9vfs0 FOREIGN KEY (player2_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3443 (class 2606 OID 17449) +-- Name: round_matches fk9quwtp4ipel9hm56p4oh0f4fh; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_matches + ADD CONSTRAINT fk9quwtp4ipel9hm56p4oh0f4fh FOREIGN KEY (matches_id) REFERENCES swiss.match(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3426 (class 2606 OID 17322) +-- Name: player_registrations fkasxo61ngph7cyje01l1n1ldhg; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_registrations + ADD CONSTRAINT fkasxo61ngph7cyje01l1n1ldhg FOREIGN KEY (registrations_id) REFERENCES swiss.registration(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3448 (class 2606 OID 17492) +-- Name: tournament_events fkb4la5xkmiin27q1du88n7gbxs; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_events + ADD CONSTRAINT fkb4la5xkmiin27q1du88n7gbxs FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3437 (class 2606 OID 17413) +-- Name: match fkci4coem3xydhawrap0y36qlmg; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT fkci4coem3xydhawrap0y36qlmg FOREIGN KEY (team2_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3416 (class 2606 OID 17246) +-- Name: event_groups fkd4r6j627kmoyxt2k0814d8k18; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_groups + ADD CONSTRAINT fkd4r6j627kmoyxt2k0814d8k18 FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3449 (class 2606 OID 17487) +-- Name: tournament_events fkfo9dvc9isnkm8hj8il8ajiea6; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_events + ADD CONSTRAINT fkfo9dvc9isnkm8hj8il8ajiea6 FOREIGN KEY (events_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3417 (class 2606 OID 17251) +-- Name: event_groups fkg4tgtn29hlh54nqxvk3uplupr; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_groups + ADD CONSTRAINT fkg4tgtn29hlh54nqxvk3uplupr FOREIGN KEY (groups_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3441 (class 2606 OID 17439) +-- Name: match_games fkgab11a4ifq5ygm14rpsrvrsuh; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match_games + ADD CONSTRAINT fkgab11a4ifq5ygm14rpsrvrsuh FOREIGN KEY (match_id) REFERENCES swiss.match(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3445 (class 2606 OID 17464) +-- Name: round_quit fkgjta0bnl9jey9c64pmcbbnj5v; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_quit + ADD CONSTRAINT fkgjta0bnl9jey9c64pmcbbnj5v FOREIGN KEY (quit_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3438 (class 2606 OID 17408) +-- Name: match fkglt3t5urqflayn544lpn5ua3s; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT fkglt3t5urqflayn544lpn5ua3s FOREIGN KEY (team1_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3452 (class 2606 OID 17523) +-- Name: tournament_tournament_players fkhhmn6g3oxtqiu99ch61h1ubcf; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_tournament_players + ADD CONSTRAINT fkhhmn6g3oxtqiu99ch61h1ubcf FOREIGN KEY (tournament_players_id) REFERENCES swiss.tournament_player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3418 (class 2606 OID 17267) +-- Name: registration fkhmyyu2ljiwo8x10kjfab1pkru; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fkhmyyu2ljiwo8x10kjfab1pkru FOREIGN KEY (partner_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3414 (class 2606 OID 17221) +-- Name: event fkidhc25ppai44aclt55uu9n0fd; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event + ADD CONSTRAINT fkidhc25ppai44aclt55uu9n0fd FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3435 (class 2606 OID 17390) +-- Name: eventgroup_rounds fkkl6r766uq2l1wpe2yals44nyw; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_rounds + ADD CONSTRAINT fkkl6r766uq2l1wpe2yals44nyw FOREIGN KEY (rounds_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3440 (class 2606 OID 17424) +-- Name: game fkkspobx32vu8ykuguwl3u0nuhd; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.game + ADD CONSTRAINT fkkspobx32vu8ykuguwl3u0nuhd FOREIGN KEY (match_id) REFERENCES swiss.match(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3422 (class 2606 OID 17292) +-- Name: event_registrations fkl4jouqv1u8b3wvwv97i1cqmm7; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_registrations + ADD CONSTRAINT fkl4jouqv1u8b3wvwv97i1cqmm7 FOREIGN KEY (registrations_id) REFERENCES swiss.registration(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3427 (class 2606 OID 17317) +-- Name: player_registrations fklc29ku8hopaa9wbmru6dtbax3; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_registrations + ADD CONSTRAINT fklc29ku8hopaa9wbmru6dtbax3 FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3453 (class 2606 OID 17518) +-- Name: tournament_tournament_players fkn7jcr3q0c3lh5gm93t0piyjyt; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_tournament_players + ADD CONSTRAINT fkn7jcr3q0c3lh5gm93t0piyjyt FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3446 (class 2606 OID 17469) +-- Name: round_quit fknkc29tpads6tq669y77d0dvwh; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_quit + ADD CONSTRAINT fknkc29tpads6tq669y77d0dvwh FOREIGN KEY (round_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3425 (class 2606 OID 17302) +-- Name: player_partner_registrations fkohcyc057xfh1bq2gcjjhx90b5; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_partner_registrations + ADD CONSTRAINT fkohcyc057xfh1bq2gcjjhx90b5 FOREIGN KEY (partner_registrations_id) REFERENCES swiss.registration(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3439 (class 2606 OID 17403) +-- Name: match fkol8rkyfucvsv37sd7kebpm1nw; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT fkol8rkyfucvsv37sd7kebpm1nw FOREIGN KEY (round_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3430 (class 2606 OID 17338) +-- Name: team fkphn10d6c8k5b758iklivfyn5y; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT fkphn10d6c8k5b758iklivfyn5y FOREIGN KEY (player1_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3442 (class 2606 OID 17434) +-- Name: match_games fkqt1fsmogbyfoo0w5bilc6rmku; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match_games + ADD CONSTRAINT fkqt1fsmogbyfoo0w5bilc6rmku FOREIGN KEY (games_id) REFERENCES swiss.game(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3444 (class 2606 OID 17454) +-- Name: round_matches fkr8lyri4t4xil8ajv8e3gjrd47; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_matches + ADD CONSTRAINT fkr8lyri4t4xil8ajv8e3gjrd47 FOREIGN KEY (round_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3450 (class 2606 OID 17503) +-- Name: tournament_player fkrqw4qfs65btri9sfkbof5xyxq; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player + ADD CONSTRAINT fkrqw4qfs65btri9sfkbof5xyxq FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3451 (class 2606 OID 17508) +-- Name: tournament_player fkrrm3jbmm1fxx5t9t5f8t46ebc; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player + ADD CONSTRAINT fkrrm3jbmm1fxx5t9t5f8t46ebc FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3423 (class 2606 OID 17287) +-- Name: event_registrations fks4kjleulewhu881p4nygwdi0; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_registrations + ADD CONSTRAINT fks4kjleulewhu881p4nygwdi0 FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3419 (class 2606 OID 17262) +-- Name: registration fks4x1uat6i8fx26qpdrfwfg3ya; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fks4x1uat6i8fx26qpdrfwfg3ya FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3415 (class 2606 OID 17236) +-- Name: eventgroup fksdpnxwfbha8j4fiwcxkfyknhv; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup + ADD CONSTRAINT fksdpnxwfbha8j4fiwcxkfyknhv FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3436 (class 2606 OID 17385) +-- Name: eventgroup_rounds fksghgh2lq09c28y7xcsmvwd63s; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_rounds + ADD CONSTRAINT fksghgh2lq09c28y7xcsmvwd63s FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3454 (class 2606 OID 17531) +-- Name: tournament_player_events fksihteat3lqwdp92fkp33oglqt; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player_events + ADD CONSTRAINT fksihteat3lqwdp92fkp33oglqt FOREIGN KEY (tournament_player_id) REFERENCES swiss.tournament_player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3420 (class 2606 OID 17272) +-- Name: registration fkswk5vywwvd2r4knle35xjygao; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fkswk5vywwvd2r4knle35xjygao FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3421 (class 2606 OID 17277) +-- Name: registration fktfm09huujek0o03wklcg9ewpq; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fktfm09huujek0o03wklcg9ewpq FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3447 (class 2606 OID 17477) +-- Name: tournament_costs_per_event fkts9nbg8r28e9ncafhnhdohai; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_costs_per_event + ADD CONSTRAINT fkts9nbg8r28e9ncafhnhdohai FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- Completed on 2024-10-11 16:03:39 UTC + +-- +-- PostgreSQL database dump complete +-- + diff --git a/src/main/resources/export2.sql b/src/main/resources/export2.sql new file mode 100755 index 0000000..b210d08 --- /dev/null +++ b/src/main/resources/export2.sql @@ -0,0 +1,3855 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 16.3 +-- Dumped by pg_dump version 16.4 + +-- Started on 2024-10-11 16:10:14 UTC + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SELECT pg_catalog.set_config('search_path', '', false); +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- TOC entry 8 (class 2615 OID 17182) +-- Name: swiss; Type: SCHEMA; Schema: -; Owner: swiss-user +-- + +CREATE SCHEMA swiss; + + +ALTER SCHEMA swiss OWNER TO "swiss-user"; + +SET default_tablespace = ''; + +SET default_table_access_method = heap; + +-- +-- TOC entry 257 (class 1259 OID 17212) +-- Name: event; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.event ( + id bigint NOT NULL, + tournament_id bigint, + status character varying(255), + type character varying(255), + CONSTRAINT event_status_check CHECK (((status)::text = ANY (ARRAY[('NOT_STARTED'::character varying)::text, ('READY_TO_PLAY'::character varying)::text, ('IN_PROGRESS'::character varying)::text, ('FINISHED'::character varying)::text]))), + CONSTRAINT event_type_check CHECK (((type)::text = ANY (ARRAY[('HE'::character varying)::text, ('DE'::character varying)::text, ('HD'::character varying)::text, ('DD'::character varying)::text, ('GD'::character varying)::text]))) +); + + +ALTER TABLE swiss.event OWNER TO "swiss-user"; + +-- +-- TOC entry 260 (class 1259 OID 17241) +-- Name: event_groups; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.event_groups ( + event_id bigint NOT NULL, + groups_id bigint NOT NULL +); + + +ALTER TABLE swiss.event_groups OWNER TO "swiss-user"; + +-- +-- TOC entry 256 (class 1259 OID 17211) +-- Name: event_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.event ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.event_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 263 (class 1259 OID 17282) +-- Name: event_registrations; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.event_registrations ( + event_id bigint NOT NULL, + registrations_id bigint NOT NULL +); + + +ALTER TABLE swiss.event_registrations OWNER TO "swiss-user"; + +-- +-- TOC entry 259 (class 1259 OID 17227) +-- Name: eventgroup; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.eventgroup ( + type smallint, + event_id bigint, + id bigint NOT NULL, + name character varying(255), + status character varying(255), + CONSTRAINT eventgroup_status_check CHECK (((status)::text = ANY (ARRAY[('NOT_STARTED'::character varying)::text, ('READY_TO_PLAY'::character varying)::text, ('IN_PROGRESS'::character varying)::text, ('FINISHED'::character varying)::text]))), + CONSTRAINT eventgroup_type_check CHECK (((type >= 0) AND (type <= 4))) +); + + +ALTER TABLE swiss.eventgroup OWNER TO "swiss-user"; + +-- +-- TOC entry 258 (class 1259 OID 17226) +-- Name: eventgroup_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.eventgroup ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.eventgroup_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 271 (class 1259 OID 17380) +-- Name: eventgroup_rounds; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.eventgroup_rounds ( + group_id bigint NOT NULL, + rounds_id bigint NOT NULL +); + + +ALTER TABLE swiss.eventgroup_rounds OWNER TO "swiss-user"; + +-- +-- TOC entry 268 (class 1259 OID 17348) +-- Name: eventgroup_teams; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.eventgroup_teams ( + group_id bigint NOT NULL, + teams_id bigint NOT NULL +); + + +ALTER TABLE swiss.eventgroup_teams OWNER TO "swiss-user"; + +-- +-- TOC entry 251 (class 1259 OID 17183) +-- Name: flyway_schema_history; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.flyway_schema_history ( + installed_rank integer NOT NULL, + version character varying(50), + description character varying(200) NOT NULL, + type character varying(20) NOT NULL, + script character varying(1000) NOT NULL, + checksum integer, + installed_by character varying(100) NOT NULL, + installed_on timestamp without time zone DEFAULT now() NOT NULL, + execution_time integer NOT NULL, + success boolean NOT NULL +); + + +ALTER TABLE swiss.flyway_schema_history OWNER TO "swiss-user"; + +-- +-- TOC entry 275 (class 1259 OID 17419) +-- Name: game; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.game ( + id bigint NOT NULL, + match_id bigint, + score1 bigint, + score2 bigint +); + + +ALTER TABLE swiss.game OWNER TO "swiss-user"; + +-- +-- TOC entry 274 (class 1259 OID 17418) +-- Name: game_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.game ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.game_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 273 (class 1259 OID 17396) +-- Name: match; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.match ( + played boolean, + status smallint, + type smallint, + court bigint, + end_time timestamp(6) without time zone, + id bigint NOT NULL, + round_id bigint, + start_time timestamp(6) without time zone, + team1_id bigint, + team2_id bigint, + CONSTRAINT match_status_check CHECK (((status >= 0) AND (status <= 3))), + CONSTRAINT match_type_check CHECK (((type >= 0) AND (type <= 4))) +); + + +ALTER TABLE swiss.match OWNER TO "swiss-user"; + +-- +-- TOC entry 276 (class 1259 OID 17429) +-- Name: match_games; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.match_games ( + games_id bigint NOT NULL, + match_id bigint NOT NULL +); + + +ALTER TABLE swiss.match_games OWNER TO "swiss-user"; + +-- +-- TOC entry 272 (class 1259 OID 17395) +-- Name: match_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.match ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.match_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 253 (class 1259 OID 17193) +-- Name: player; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.player ( + birthday date NOT NULL, + id bigint NOT NULL, + club character varying(255), + email character varying(255) NOT NULL, + first_name character varying(255) NOT NULL, + last_name character varying(255) NOT NULL, + middle_name character varying(255), + phone_number character varying(255) NOT NULL, + sex character varying(255) NOT NULL, + strength character varying(255) NOT NULL, + CONSTRAINT player_sex_check CHECK (((sex)::text = ANY (ARRAY[('M'::character varying)::text, ('V'::character varying)::text]))), + CONSTRAINT player_strength_check CHECK (((strength)::text = ANY (ARRAY[('D5'::character varying)::text, ('D6'::character varying)::text, ('D7'::character varying)::text, ('D8'::character varying)::text, ('D9'::character varying)::text, ('DR'::character varying)::text]))) +); + + +ALTER TABLE swiss.player OWNER TO "swiss-user"; + +-- +-- TOC entry 252 (class 1259 OID 17192) +-- Name: player_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.player ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.player_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 264 (class 1259 OID 17297) +-- Name: player_partner_registrations; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.player_partner_registrations ( + partner_registrations_id bigint NOT NULL, + player_id bigint NOT NULL +); + + +ALTER TABLE swiss.player_partner_registrations OWNER TO "swiss-user"; + +-- +-- TOC entry 265 (class 1259 OID 17312) +-- Name: player_registrations; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.player_registrations ( + player_id bigint NOT NULL, + registrations_id bigint NOT NULL +); + + +ALTER TABLE swiss.player_registrations OWNER TO "swiss-user"; + +-- +-- TOC entry 262 (class 1259 OID 17257) +-- Name: registration; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.registration ( + event_id bigint, + id bigint NOT NULL, + partner_id bigint, + player_id bigint, + tournament_id bigint +); + + +ALTER TABLE swiss.registration OWNER TO "swiss-user"; + +-- +-- TOC entry 261 (class 1259 OID 17256) +-- Name: registration_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.registration ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.registration_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 270 (class 1259 OID 17364) +-- Name: round; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.round ( + status smallint, + drawn_out_id bigint, + group_id bigint, + id bigint NOT NULL, + name character varying(255), + CONSTRAINT round_status_check CHECK (((status >= 0) AND (status <= 3))) +); + + +ALTER TABLE swiss.round OWNER TO "swiss-user"; + +-- +-- TOC entry 269 (class 1259 OID 17363) +-- Name: round_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.round ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.round_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 277 (class 1259 OID 17444) +-- Name: round_matches; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.round_matches ( + matches_id bigint NOT NULL, + round_id bigint NOT NULL +); + + +ALTER TABLE swiss.round_matches OWNER TO "swiss-user"; + +-- +-- TOC entry 278 (class 1259 OID 17459) +-- Name: round_quit; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.round_quit ( + quit_id bigint NOT NULL, + round_id bigint NOT NULL +); + + +ALTER TABLE swiss.round_quit OWNER TO "swiss-user"; + +-- +-- TOC entry 267 (class 1259 OID 17328) +-- Name: team; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.team ( + group_id bigint, + id bigint NOT NULL, + player1_id bigint, + player2_id bigint +); + + +ALTER TABLE swiss.team OWNER TO "swiss-user"; + +-- +-- TOC entry 266 (class 1259 OID 17327) +-- Name: team_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.team ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.team_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 255 (class 1259 OID 17203) +-- Name: tournament; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament ( + date date, + courts bigint, + id bigint NOT NULL, + max_events bigint, + name character varying(255), + status character varying(255), + CONSTRAINT tournament_status_check CHECK (((status)::text = ANY (ARRAY[('UPCOMING'::character varying)::text, ('DIVIDED'::character varying)::text, ('DRAWN'::character varying)::text, ('ONGOING'::character varying)::text, ('CLOSED'::character varying)::text]))) +); + + +ALTER TABLE swiss.tournament OWNER TO "swiss-user"; + +-- +-- TOC entry 279 (class 1259 OID 17474) +-- Name: tournament_costs_per_event; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_costs_per_event ( + costs_per_event real, + tournament_id bigint NOT NULL +); + + +ALTER TABLE swiss.tournament_costs_per_event OWNER TO "swiss-user"; + +-- +-- TOC entry 280 (class 1259 OID 17482) +-- Name: tournament_events; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_events ( + events_id bigint NOT NULL, + tournament_id bigint NOT NULL +); + + +ALTER TABLE swiss.tournament_events OWNER TO "swiss-user"; + +-- +-- TOC entry 254 (class 1259 OID 17202) +-- Name: tournament_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.tournament ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.tournament_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 282 (class 1259 OID 17498) +-- Name: tournament_player; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_player ( + paid boolean NOT NULL, + present boolean NOT NULL, + id bigint NOT NULL, + player_id bigint, + tournament_id bigint +); + + +ALTER TABLE swiss.tournament_player OWNER TO "swiss-user"; + +-- +-- TOC entry 284 (class 1259 OID 17528) +-- Name: tournament_player_events; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_player_events ( + tournament_player_id bigint NOT NULL, + events character varying(255) +); + + +ALTER TABLE swiss.tournament_player_events OWNER TO "swiss-user"; + +-- +-- TOC entry 281 (class 1259 OID 17497) +-- Name: tournament_player_id_seq; Type: SEQUENCE; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE swiss.tournament_player ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY ( + SEQUENCE NAME swiss.tournament_player_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1 +); + + +-- +-- TOC entry 283 (class 1259 OID 17513) +-- Name: tournament_tournament_players; Type: TABLE; Schema: swiss; Owner: swiss-user +-- + +CREATE TABLE swiss.tournament_tournament_players ( + tournament_id bigint NOT NULL, + tournament_players_id bigint NOT NULL +); + + +ALTER TABLE swiss.tournament_tournament_players OWNER TO "swiss-user"; + +-- +-- TOC entry 3604 (class 0 OID 17212) +-- Dependencies: 257 +-- Data for Name: event; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.event VALUES (21, 5, 'NOT_STARTED', 'HE'); +INSERT INTO swiss.event VALUES (22, 5, 'NOT_STARTED', 'DE'); +INSERT INTO swiss.event VALUES (23, 5, 'NOT_STARTED', 'HD'); +INSERT INTO swiss.event VALUES (24, 5, 'NOT_STARTED', 'DD'); +INSERT INTO swiss.event VALUES (25, 5, 'NOT_STARTED', 'GD'); +INSERT INTO swiss.event VALUES (26, 6, 'NOT_STARTED', 'HE'); +INSERT INTO swiss.event VALUES (27, 6, 'NOT_STARTED', 'DE'); +INSERT INTO swiss.event VALUES (28, 6, 'NOT_STARTED', 'HD'); +INSERT INTO swiss.event VALUES (29, 6, 'NOT_STARTED', 'DD'); +INSERT INTO swiss.event VALUES (30, 6, 'NOT_STARTED', 'GD'); +INSERT INTO swiss.event VALUES (31, 7, 'NOT_STARTED', 'HE'); +INSERT INTO swiss.event VALUES (32, 7, 'NOT_STARTED', 'DE'); +INSERT INTO swiss.event VALUES (33, 7, 'NOT_STARTED', 'HD'); +INSERT INTO swiss.event VALUES (34, 7, 'NOT_STARTED', 'DD'); +INSERT INTO swiss.event VALUES (35, 7, 'NOT_STARTED', 'GD'); +INSERT INTO swiss.event VALUES (36, 8, 'NOT_STARTED', 'HE'); +INSERT INTO swiss.event VALUES (37, 8, 'NOT_STARTED', 'DE'); +INSERT INTO swiss.event VALUES (38, 8, 'NOT_STARTED', 'HD'); +INSERT INTO swiss.event VALUES (39, 8, 'NOT_STARTED', 'DD'); +INSERT INTO swiss.event VALUES (40, 8, 'NOT_STARTED', 'GD'); + + +-- +-- TOC entry 3607 (class 0 OID 17241) +-- Dependencies: 260 +-- Data for Name: event_groups; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.event_groups VALUES (21, 22); +INSERT INTO swiss.event_groups VALUES (21, 23); +INSERT INTO swiss.event_groups VALUES (22, 24); +INSERT INTO swiss.event_groups VALUES (22, 25); +INSERT INTO swiss.event_groups VALUES (23, 26); +INSERT INTO swiss.event_groups VALUES (24, 27); +INSERT INTO swiss.event_groups VALUES (25, 28); +INSERT INTO swiss.event_groups VALUES (26, 29); +INSERT INTO swiss.event_groups VALUES (28, 30); +INSERT INTO swiss.event_groups VALUES (30, 31); + + +-- +-- TOC entry 3610 (class 0 OID 17282) +-- Dependencies: 263 +-- Data for Name: event_registrations; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.event_registrations VALUES (28, 675); +INSERT INTO swiss.event_registrations VALUES (28, 679); +INSERT INTO swiss.event_registrations VALUES (28, 684); +INSERT INTO swiss.event_registrations VALUES (28, 677); +INSERT INTO swiss.event_registrations VALUES (28, 672); +INSERT INTO swiss.event_registrations VALUES (28, 671); +INSERT INTO swiss.event_registrations VALUES (28, 669); +INSERT INTO swiss.event_registrations VALUES (28, 870); +INSERT INTO swiss.event_registrations VALUES (30, 681); +INSERT INTO swiss.event_registrations VALUES (30, 683); +INSERT INTO swiss.event_registrations VALUES (30, 685); +INSERT INTO swiss.event_registrations VALUES (30, 678); +INSERT INTO swiss.event_registrations VALUES (30, 673); +INSERT INTO swiss.event_registrations VALUES (30, 871); +INSERT INTO swiss.event_registrations VALUES (40, 1095); +INSERT INTO swiss.event_registrations VALUES (40, 1096); +INSERT INTO swiss.event_registrations VALUES (40, 1097); +INSERT INTO swiss.event_registrations VALUES (40, 1098); +INSERT INTO swiss.event_registrations VALUES (40, 1099); +INSERT INTO swiss.event_registrations VALUES (40, 1100); +INSERT INTO swiss.event_registrations VALUES (40, 1101); +INSERT INTO swiss.event_registrations VALUES (40, 1102); +INSERT INTO swiss.event_registrations VALUES (40, 1103); +INSERT INTO swiss.event_registrations VALUES (40, 1104); +INSERT INTO swiss.event_registrations VALUES (40, 1105); +INSERT INTO swiss.event_registrations VALUES (40, 1106); +INSERT INTO swiss.event_registrations VALUES (40, 1107); +INSERT INTO swiss.event_registrations VALUES (40, 1108); +INSERT INTO swiss.event_registrations VALUES (40, 1109); +INSERT INTO swiss.event_registrations VALUES (40, 1110); +INSERT INTO swiss.event_registrations VALUES (40, 1111); +INSERT INTO swiss.event_registrations VALUES (40, 1112); +INSERT INTO swiss.event_registrations VALUES (40, 1113); +INSERT INTO swiss.event_registrations VALUES (40, 1114); +INSERT INTO swiss.event_registrations VALUES (40, 1115); +INSERT INTO swiss.event_registrations VALUES (40, 1116); +INSERT INTO swiss.event_registrations VALUES (40, 1117); +INSERT INTO swiss.event_registrations VALUES (40, 1118); +INSERT INTO swiss.event_registrations VALUES (23, 624); +INSERT INTO swiss.event_registrations VALUES (23, 622); +INSERT INTO swiss.event_registrations VALUES (23, 621); +INSERT INTO swiss.event_registrations VALUES (23, 620); +INSERT INTO swiss.event_registrations VALUES (23, 619); +INSERT INTO swiss.event_registrations VALUES (23, 618); +INSERT INTO swiss.event_registrations VALUES (23, 617); +INSERT INTO swiss.event_registrations VALUES (23, 616); +INSERT INTO swiss.event_registrations VALUES (23, 615); +INSERT INTO swiss.event_registrations VALUES (23, 614); +INSERT INTO swiss.event_registrations VALUES (23, 613); +INSERT INTO swiss.event_registrations VALUES (23, 612); +INSERT INTO swiss.event_registrations VALUES (23, 611); +INSERT INTO swiss.event_registrations VALUES (23, 667); +INSERT INTO swiss.event_registrations VALUES (26, 674); +INSERT INTO swiss.event_registrations VALUES (26, 670); +INSERT INTO swiss.event_registrations VALUES (26, 668); +INSERT INTO swiss.event_registrations VALUES (26, 676); +INSERT INTO swiss.event_registrations VALUES (27, 680); +INSERT INTO swiss.event_registrations VALUES (27, 682); +INSERT INTO swiss.event_registrations VALUES (39, 1077); +INSERT INTO swiss.event_registrations VALUES (39, 1078); +INSERT INTO swiss.event_registrations VALUES (39, 1079); +INSERT INTO swiss.event_registrations VALUES (39, 1080); +INSERT INTO swiss.event_registrations VALUES (39, 1081); +INSERT INTO swiss.event_registrations VALUES (39, 1082); +INSERT INTO swiss.event_registrations VALUES (39, 1083); +INSERT INTO swiss.event_registrations VALUES (39, 1084); +INSERT INTO swiss.event_registrations VALUES (39, 1085); +INSERT INTO swiss.event_registrations VALUES (39, 1086); +INSERT INTO swiss.event_registrations VALUES (39, 1087); +INSERT INTO swiss.event_registrations VALUES (39, 1088); +INSERT INTO swiss.event_registrations VALUES (39, 1089); +INSERT INTO swiss.event_registrations VALUES (39, 1090); +INSERT INTO swiss.event_registrations VALUES (39, 1091); +INSERT INTO swiss.event_registrations VALUES (39, 1092); +INSERT INTO swiss.event_registrations VALUES (39, 1093); +INSERT INTO swiss.event_registrations VALUES (39, 1094); +INSERT INTO swiss.event_registrations VALUES (21, 577); +INSERT INTO swiss.event_registrations VALUES (21, 576); +INSERT INTO swiss.event_registrations VALUES (21, 575); +INSERT INTO swiss.event_registrations VALUES (21, 574); +INSERT INTO swiss.event_registrations VALUES (21, 573); +INSERT INTO swiss.event_registrations VALUES (21, 572); +INSERT INTO swiss.event_registrations VALUES (21, 571); +INSERT INTO swiss.event_registrations VALUES (21, 570); +INSERT INTO swiss.event_registrations VALUES (21, 569); +INSERT INTO swiss.event_registrations VALUES (21, 568); +INSERT INTO swiss.event_registrations VALUES (21, 567); +INSERT INTO swiss.event_registrations VALUES (21, 566); +INSERT INTO swiss.event_registrations VALUES (21, 565); +INSERT INTO swiss.event_registrations VALUES (21, 564); +INSERT INTO swiss.event_registrations VALUES (21, 563); +INSERT INTO swiss.event_registrations VALUES (21, 562); +INSERT INTO swiss.event_registrations VALUES (21, 561); +INSERT INTO swiss.event_registrations VALUES (21, 560); +INSERT INTO swiss.event_registrations VALUES (21, 559); +INSERT INTO swiss.event_registrations VALUES (21, 558); +INSERT INTO swiss.event_registrations VALUES (21, 557); +INSERT INTO swiss.event_registrations VALUES (21, 556); +INSERT INTO swiss.event_registrations VALUES (21, 555); +INSERT INTO swiss.event_registrations VALUES (21, 554); +INSERT INTO swiss.event_registrations VALUES (21, 553); +INSERT INTO swiss.event_registrations VALUES (21, 552); +INSERT INTO swiss.event_registrations VALUES (21, 551); +INSERT INTO swiss.event_registrations VALUES (21, 550); +INSERT INTO swiss.event_registrations VALUES (21, 549); +INSERT INTO swiss.event_registrations VALUES (21, 548); +INSERT INTO swiss.event_registrations VALUES (21, 578); +INSERT INTO swiss.event_registrations VALUES (25, 664); +INSERT INTO swiss.event_registrations VALUES (25, 662); +INSERT INTO swiss.event_registrations VALUES (25, 660); +INSERT INTO swiss.event_registrations VALUES (25, 658); +INSERT INTO swiss.event_registrations VALUES (25, 656); +INSERT INTO swiss.event_registrations VALUES (25, 654); +INSERT INTO swiss.event_registrations VALUES (25, 652); +INSERT INTO swiss.event_registrations VALUES (25, 650); +INSERT INTO swiss.event_registrations VALUES (25, 648); +INSERT INTO swiss.event_registrations VALUES (25, 646); +INSERT INTO swiss.event_registrations VALUES (25, 644); +INSERT INTO swiss.event_registrations VALUES (25, 665); +INSERT INTO swiss.event_registrations VALUES (25, 663); +INSERT INTO swiss.event_registrations VALUES (25, 661); +INSERT INTO swiss.event_registrations VALUES (25, 659); +INSERT INTO swiss.event_registrations VALUES (25, 657); +INSERT INTO swiss.event_registrations VALUES (25, 655); +INSERT INTO swiss.event_registrations VALUES (25, 653); +INSERT INTO swiss.event_registrations VALUES (25, 651); +INSERT INTO swiss.event_registrations VALUES (25, 649); +INSERT INTO swiss.event_registrations VALUES (25, 647); +INSERT INTO swiss.event_registrations VALUES (25, 645); +INSERT INTO swiss.event_registrations VALUES (25, 643); +INSERT INTO swiss.event_registrations VALUES (25, 666); +INSERT INTO swiss.event_registrations VALUES (22, 609); +INSERT INTO swiss.event_registrations VALUES (22, 608); +INSERT INTO swiss.event_registrations VALUES (22, 607); +INSERT INTO swiss.event_registrations VALUES (22, 606); +INSERT INTO swiss.event_registrations VALUES (22, 605); +INSERT INTO swiss.event_registrations VALUES (22, 604); +INSERT INTO swiss.event_registrations VALUES (22, 603); +INSERT INTO swiss.event_registrations VALUES (22, 602); +INSERT INTO swiss.event_registrations VALUES (22, 601); +INSERT INTO swiss.event_registrations VALUES (22, 600); +INSERT INTO swiss.event_registrations VALUES (22, 599); +INSERT INTO swiss.event_registrations VALUES (22, 598); +INSERT INTO swiss.event_registrations VALUES (22, 597); +INSERT INTO swiss.event_registrations VALUES (22, 596); +INSERT INTO swiss.event_registrations VALUES (22, 595); +INSERT INTO swiss.event_registrations VALUES (22, 594); +INSERT INTO swiss.event_registrations VALUES (22, 593); +INSERT INTO swiss.event_registrations VALUES (22, 592); +INSERT INTO swiss.event_registrations VALUES (22, 591); +INSERT INTO swiss.event_registrations VALUES (22, 590); +INSERT INTO swiss.event_registrations VALUES (22, 589); +INSERT INTO swiss.event_registrations VALUES (22, 588); +INSERT INTO swiss.event_registrations VALUES (22, 587); +INSERT INTO swiss.event_registrations VALUES (22, 586); +INSERT INTO swiss.event_registrations VALUES (22, 585); +INSERT INTO swiss.event_registrations VALUES (22, 584); +INSERT INTO swiss.event_registrations VALUES (22, 583); +INSERT INTO swiss.event_registrations VALUES (22, 582); +INSERT INTO swiss.event_registrations VALUES (22, 581); +INSERT INTO swiss.event_registrations VALUES (22, 580); +INSERT INTO swiss.event_registrations VALUES (22, 579); +INSERT INTO swiss.event_registrations VALUES (22, 610); +INSERT INTO swiss.event_registrations VALUES (24, 641); +INSERT INTO swiss.event_registrations VALUES (24, 640); +INSERT INTO swiss.event_registrations VALUES (24, 639); +INSERT INTO swiss.event_registrations VALUES (24, 638); +INSERT INTO swiss.event_registrations VALUES (24, 637); +INSERT INTO swiss.event_registrations VALUES (24, 636); +INSERT INTO swiss.event_registrations VALUES (24, 635); +INSERT INTO swiss.event_registrations VALUES (24, 634); +INSERT INTO swiss.event_registrations VALUES (24, 633); +INSERT INTO swiss.event_registrations VALUES (24, 632); +INSERT INTO swiss.event_registrations VALUES (24, 631); +INSERT INTO swiss.event_registrations VALUES (24, 630); +INSERT INTO swiss.event_registrations VALUES (24, 629); +INSERT INTO swiss.event_registrations VALUES (24, 628); +INSERT INTO swiss.event_registrations VALUES (24, 627); +INSERT INTO swiss.event_registrations VALUES (24, 626); +INSERT INTO swiss.event_registrations VALUES (24, 625); +INSERT INTO swiss.event_registrations VALUES (24, 642); +INSERT INTO swiss.event_registrations VALUES (32, 786); +INSERT INTO swiss.event_registrations VALUES (32, 687); +INSERT INTO swiss.event_registrations VALUES (32, 694); +INSERT INTO swiss.event_registrations VALUES (32, 695); +INSERT INTO swiss.event_registrations VALUES (32, 696); +INSERT INTO swiss.event_registrations VALUES (32, 697); +INSERT INTO swiss.event_registrations VALUES (32, 698); +INSERT INTO swiss.event_registrations VALUES (32, 699); +INSERT INTO swiss.event_registrations VALUES (32, 700); +INSERT INTO swiss.event_registrations VALUES (32, 701); +INSERT INTO swiss.event_registrations VALUES (32, 702); +INSERT INTO swiss.event_registrations VALUES (32, 703); +INSERT INTO swiss.event_registrations VALUES (32, 704); +INSERT INTO swiss.event_registrations VALUES (32, 705); +INSERT INTO swiss.event_registrations VALUES (32, 706); +INSERT INTO swiss.event_registrations VALUES (32, 707); +INSERT INTO swiss.event_registrations VALUES (32, 708); +INSERT INTO swiss.event_registrations VALUES (32, 709); +INSERT INTO swiss.event_registrations VALUES (32, 710); +INSERT INTO swiss.event_registrations VALUES (32, 711); +INSERT INTO swiss.event_registrations VALUES (32, 712); +INSERT INTO swiss.event_registrations VALUES (32, 713); +INSERT INTO swiss.event_registrations VALUES (32, 714); +INSERT INTO swiss.event_registrations VALUES (32, 715); +INSERT INTO swiss.event_registrations VALUES (32, 716); +INSERT INTO swiss.event_registrations VALUES (32, 717); +INSERT INTO swiss.event_registrations VALUES (32, 718); +INSERT INTO swiss.event_registrations VALUES (32, 719); +INSERT INTO swiss.event_registrations VALUES (32, 720); +INSERT INTO swiss.event_registrations VALUES (32, 721); +INSERT INTO swiss.event_registrations VALUES (32, 722); +INSERT INTO swiss.event_registrations VALUES (32, 723); +INSERT INTO swiss.event_registrations VALUES (32, 724); +INSERT INTO swiss.event_registrations VALUES (32, 725); +INSERT INTO swiss.event_registrations VALUES (32, 757); +INSERT INTO swiss.event_registrations VALUES (32, 758); +INSERT INTO swiss.event_registrations VALUES (32, 759); +INSERT INTO swiss.event_registrations VALUES (32, 760); +INSERT INTO swiss.event_registrations VALUES (32, 761); +INSERT INTO swiss.event_registrations VALUES (32, 762); +INSERT INTO swiss.event_registrations VALUES (32, 763); +INSERT INTO swiss.event_registrations VALUES (32, 764); +INSERT INTO swiss.event_registrations VALUES (32, 765); +INSERT INTO swiss.event_registrations VALUES (32, 766); +INSERT INTO swiss.event_registrations VALUES (32, 767); +INSERT INTO swiss.event_registrations VALUES (32, 768); +INSERT INTO swiss.event_registrations VALUES (32, 769); +INSERT INTO swiss.event_registrations VALUES (32, 770); +INSERT INTO swiss.event_registrations VALUES (32, 771); +INSERT INTO swiss.event_registrations VALUES (32, 772); +INSERT INTO swiss.event_registrations VALUES (32, 773); +INSERT INTO swiss.event_registrations VALUES (32, 774); +INSERT INTO swiss.event_registrations VALUES (32, 775); +INSERT INTO swiss.event_registrations VALUES (32, 776); +INSERT INTO swiss.event_registrations VALUES (32, 777); +INSERT INTO swiss.event_registrations VALUES (32, 778); +INSERT INTO swiss.event_registrations VALUES (32, 779); +INSERT INTO swiss.event_registrations VALUES (32, 780); +INSERT INTO swiss.event_registrations VALUES (32, 781); +INSERT INTO swiss.event_registrations VALUES (32, 782); +INSERT INTO swiss.event_registrations VALUES (32, 783); +INSERT INTO swiss.event_registrations VALUES (32, 784); +INSERT INTO swiss.event_registrations VALUES (32, 785); +INSERT INTO swiss.event_registrations VALUES (32, 787); +INSERT INTO swiss.event_registrations VALUES (32, 788); +INSERT INTO swiss.event_registrations VALUES (31, 686); +INSERT INTO swiss.event_registrations VALUES (31, 688); +INSERT INTO swiss.event_registrations VALUES (31, 689); +INSERT INTO swiss.event_registrations VALUES (31, 690); +INSERT INTO swiss.event_registrations VALUES (31, 691); +INSERT INTO swiss.event_registrations VALUES (31, 692); +INSERT INTO swiss.event_registrations VALUES (31, 693); +INSERT INTO swiss.event_registrations VALUES (31, 726); +INSERT INTO swiss.event_registrations VALUES (31, 727); +INSERT INTO swiss.event_registrations VALUES (31, 728); +INSERT INTO swiss.event_registrations VALUES (31, 729); +INSERT INTO swiss.event_registrations VALUES (31, 730); +INSERT INTO swiss.event_registrations VALUES (31, 731); +INSERT INTO swiss.event_registrations VALUES (31, 732); +INSERT INTO swiss.event_registrations VALUES (31, 733); +INSERT INTO swiss.event_registrations VALUES (31, 734); +INSERT INTO swiss.event_registrations VALUES (31, 735); +INSERT INTO swiss.event_registrations VALUES (31, 736); +INSERT INTO swiss.event_registrations VALUES (31, 737); +INSERT INTO swiss.event_registrations VALUES (31, 738); +INSERT INTO swiss.event_registrations VALUES (31, 739); +INSERT INTO swiss.event_registrations VALUES (31, 740); +INSERT INTO swiss.event_registrations VALUES (31, 741); +INSERT INTO swiss.event_registrations VALUES (31, 742); +INSERT INTO swiss.event_registrations VALUES (31, 743); +INSERT INTO swiss.event_registrations VALUES (31, 744); +INSERT INTO swiss.event_registrations VALUES (31, 745); +INSERT INTO swiss.event_registrations VALUES (31, 746); +INSERT INTO swiss.event_registrations VALUES (31, 747); +INSERT INTO swiss.event_registrations VALUES (31, 748); +INSERT INTO swiss.event_registrations VALUES (31, 749); +INSERT INTO swiss.event_registrations VALUES (31, 750); +INSERT INTO swiss.event_registrations VALUES (31, 751); +INSERT INTO swiss.event_registrations VALUES (31, 752); +INSERT INTO swiss.event_registrations VALUES (31, 753); +INSERT INTO swiss.event_registrations VALUES (31, 754); +INSERT INTO swiss.event_registrations VALUES (31, 755); +INSERT INTO swiss.event_registrations VALUES (31, 756); +INSERT INTO swiss.event_registrations VALUES (31, 789); +INSERT INTO swiss.event_registrations VALUES (31, 790); +INSERT INTO swiss.event_registrations VALUES (31, 791); +INSERT INTO swiss.event_registrations VALUES (31, 792); +INSERT INTO swiss.event_registrations VALUES (31, 793); +INSERT INTO swiss.event_registrations VALUES (31, 794); +INSERT INTO swiss.event_registrations VALUES (31, 795); +INSERT INTO swiss.event_registrations VALUES (31, 796); +INSERT INTO swiss.event_registrations VALUES (31, 797); +INSERT INTO swiss.event_registrations VALUES (31, 798); +INSERT INTO swiss.event_registrations VALUES (31, 799); +INSERT INTO swiss.event_registrations VALUES (31, 800); +INSERT INTO swiss.event_registrations VALUES (31, 801); +INSERT INTO swiss.event_registrations VALUES (31, 802); +INSERT INTO swiss.event_registrations VALUES (31, 803); +INSERT INTO swiss.event_registrations VALUES (31, 804); +INSERT INTO swiss.event_registrations VALUES (31, 805); +INSERT INTO swiss.event_registrations VALUES (31, 806); +INSERT INTO swiss.event_registrations VALUES (31, 807); +INSERT INTO swiss.event_registrations VALUES (31, 808); +INSERT INTO swiss.event_registrations VALUES (31, 809); +INSERT INTO swiss.event_registrations VALUES (31, 810); +INSERT INTO swiss.event_registrations VALUES (31, 811); +INSERT INTO swiss.event_registrations VALUES (31, 812); +INSERT INTO swiss.event_registrations VALUES (31, 813); +INSERT INTO swiss.event_registrations VALUES (33, 826); +INSERT INTO swiss.event_registrations VALUES (33, 824); +INSERT INTO swiss.event_registrations VALUES (33, 825); +INSERT INTO swiss.event_registrations VALUES (33, 822); +INSERT INTO swiss.event_registrations VALUES (33, 823); +INSERT INTO swiss.event_registrations VALUES (33, 820); +INSERT INTO swiss.event_registrations VALUES (33, 821); +INSERT INTO swiss.event_registrations VALUES (33, 818); +INSERT INTO swiss.event_registrations VALUES (33, 819); +INSERT INTO swiss.event_registrations VALUES (33, 816); +INSERT INTO swiss.event_registrations VALUES (33, 817); +INSERT INTO swiss.event_registrations VALUES (33, 814); +INSERT INTO swiss.event_registrations VALUES (33, 815); +INSERT INTO swiss.event_registrations VALUES (33, 827); +INSERT INTO swiss.event_registrations VALUES (34, 844); +INSERT INTO swiss.event_registrations VALUES (34, 842); +INSERT INTO swiss.event_registrations VALUES (34, 843); +INSERT INTO swiss.event_registrations VALUES (34, 840); +INSERT INTO swiss.event_registrations VALUES (34, 841); +INSERT INTO swiss.event_registrations VALUES (34, 838); +INSERT INTO swiss.event_registrations VALUES (34, 839); +INSERT INTO swiss.event_registrations VALUES (34, 836); +INSERT INTO swiss.event_registrations VALUES (34, 837); +INSERT INTO swiss.event_registrations VALUES (34, 834); +INSERT INTO swiss.event_registrations VALUES (34, 835); +INSERT INTO swiss.event_registrations VALUES (34, 832); +INSERT INTO swiss.event_registrations VALUES (34, 833); +INSERT INTO swiss.event_registrations VALUES (34, 830); +INSERT INTO swiss.event_registrations VALUES (34, 831); +INSERT INTO swiss.event_registrations VALUES (34, 828); +INSERT INTO swiss.event_registrations VALUES (34, 829); +INSERT INTO swiss.event_registrations VALUES (34, 845); +INSERT INTO swiss.event_registrations VALUES (35, 867); +INSERT INTO swiss.event_registrations VALUES (35, 865); +INSERT INTO swiss.event_registrations VALUES (35, 863); +INSERT INTO swiss.event_registrations VALUES (35, 861); +INSERT INTO swiss.event_registrations VALUES (35, 859); +INSERT INTO swiss.event_registrations VALUES (35, 857); +INSERT INTO swiss.event_registrations VALUES (35, 855); +INSERT INTO swiss.event_registrations VALUES (35, 853); +INSERT INTO swiss.event_registrations VALUES (35, 851); +INSERT INTO swiss.event_registrations VALUES (35, 849); +INSERT INTO swiss.event_registrations VALUES (35, 847); +INSERT INTO swiss.event_registrations VALUES (35, 868); +INSERT INTO swiss.event_registrations VALUES (35, 866); +INSERT INTO swiss.event_registrations VALUES (35, 864); +INSERT INTO swiss.event_registrations VALUES (35, 862); +INSERT INTO swiss.event_registrations VALUES (35, 860); +INSERT INTO swiss.event_registrations VALUES (35, 858); +INSERT INTO swiss.event_registrations VALUES (35, 856); +INSERT INTO swiss.event_registrations VALUES (35, 854); +INSERT INTO swiss.event_registrations VALUES (35, 852); +INSERT INTO swiss.event_registrations VALUES (35, 850); +INSERT INTO swiss.event_registrations VALUES (35, 848); +INSERT INTO swiss.event_registrations VALUES (35, 846); +INSERT INTO swiss.event_registrations VALUES (35, 869); +INSERT INTO swiss.event_registrations VALUES (36, 1044); +INSERT INTO swiss.event_registrations VALUES (36, 1043); +INSERT INTO swiss.event_registrations VALUES (36, 1027); +INSERT INTO swiss.event_registrations VALUES (36, 1026); +INSERT INTO swiss.event_registrations VALUES (36, 1025); +INSERT INTO swiss.event_registrations VALUES (36, 1024); +INSERT INTO swiss.event_registrations VALUES (36, 1023); +INSERT INTO swiss.event_registrations VALUES (36, 1022); +INSERT INTO swiss.event_registrations VALUES (36, 1021); +INSERT INTO swiss.event_registrations VALUES (36, 1020); +INSERT INTO swiss.event_registrations VALUES (36, 1019); +INSERT INTO swiss.event_registrations VALUES (36, 1018); +INSERT INTO swiss.event_registrations VALUES (36, 1017); +INSERT INTO swiss.event_registrations VALUES (36, 1016); +INSERT INTO swiss.event_registrations VALUES (36, 1015); +INSERT INTO swiss.event_registrations VALUES (36, 1014); +INSERT INTO swiss.event_registrations VALUES (36, 1013); +INSERT INTO swiss.event_registrations VALUES (36, 1012); +INSERT INTO swiss.event_registrations VALUES (36, 1011); +INSERT INTO swiss.event_registrations VALUES (36, 1010); +INSERT INTO swiss.event_registrations VALUES (36, 1009); +INSERT INTO swiss.event_registrations VALUES (36, 1008); +INSERT INTO swiss.event_registrations VALUES (36, 1007); +INSERT INTO swiss.event_registrations VALUES (36, 1006); +INSERT INTO swiss.event_registrations VALUES (36, 1005); +INSERT INTO swiss.event_registrations VALUES (36, 1004); +INSERT INTO swiss.event_registrations VALUES (36, 1003); +INSERT INTO swiss.event_registrations VALUES (36, 1002); +INSERT INTO swiss.event_registrations VALUES (36, 1001); +INSERT INTO swiss.event_registrations VALUES (36, 1000); +INSERT INTO swiss.event_registrations VALUES (36, 999); +INSERT INTO swiss.event_registrations VALUES (36, 966); +INSERT INTO swiss.event_registrations VALUES (36, 965); +INSERT INTO swiss.event_registrations VALUES (36, 964); +INSERT INTO swiss.event_registrations VALUES (36, 963); +INSERT INTO swiss.event_registrations VALUES (36, 962); +INSERT INTO swiss.event_registrations VALUES (36, 961); +INSERT INTO swiss.event_registrations VALUES (36, 960); +INSERT INTO swiss.event_registrations VALUES (36, 959); +INSERT INTO swiss.event_registrations VALUES (36, 958); +INSERT INTO swiss.event_registrations VALUES (36, 957); +INSERT INTO swiss.event_registrations VALUES (36, 956); +INSERT INTO swiss.event_registrations VALUES (36, 955); +INSERT INTO swiss.event_registrations VALUES (36, 954); +INSERT INTO swiss.event_registrations VALUES (36, 953); +INSERT INTO swiss.event_registrations VALUES (36, 952); +INSERT INTO swiss.event_registrations VALUES (36, 951); +INSERT INTO swiss.event_registrations VALUES (36, 950); +INSERT INTO swiss.event_registrations VALUES (36, 949); +INSERT INTO swiss.event_registrations VALUES (36, 948); +INSERT INTO swiss.event_registrations VALUES (36, 947); +INSERT INTO swiss.event_registrations VALUES (36, 946); +INSERT INTO swiss.event_registrations VALUES (36, 945); +INSERT INTO swiss.event_registrations VALUES (36, 944); +INSERT INTO swiss.event_registrations VALUES (36, 943); +INSERT INTO swiss.event_registrations VALUES (36, 942); +INSERT INTO swiss.event_registrations VALUES (36, 941); +INSERT INTO swiss.event_registrations VALUES (36, 940); +INSERT INTO swiss.event_registrations VALUES (36, 939); +INSERT INTO swiss.event_registrations VALUES (36, 938); +INSERT INTO swiss.event_registrations VALUES (36, 937); +INSERT INTO swiss.event_registrations VALUES (36, 936); +INSERT INTO swiss.event_registrations VALUES (36, 935); +INSERT INTO swiss.event_registrations VALUES (36, 934); +INSERT INTO swiss.event_registrations VALUES (36, 933); +INSERT INTO swiss.event_registrations VALUES (36, 932); +INSERT INTO swiss.event_registrations VALUES (36, 931); +INSERT INTO swiss.event_registrations VALUES (36, 930); +INSERT INTO swiss.event_registrations VALUES (36, 929); +INSERT INTO swiss.event_registrations VALUES (36, 928); +INSERT INTO swiss.event_registrations VALUES (36, 927); +INSERT INTO swiss.event_registrations VALUES (36, 926); +INSERT INTO swiss.event_registrations VALUES (36, 925); +INSERT INTO swiss.event_registrations VALUES (36, 924); +INSERT INTO swiss.event_registrations VALUES (36, 923); +INSERT INTO swiss.event_registrations VALUES (36, 922); +INSERT INTO swiss.event_registrations VALUES (36, 921); +INSERT INTO swiss.event_registrations VALUES (36, 920); +INSERT INTO swiss.event_registrations VALUES (36, 919); +INSERT INTO swiss.event_registrations VALUES (36, 918); +INSERT INTO swiss.event_registrations VALUES (36, 917); +INSERT INTO swiss.event_registrations VALUES (36, 916); +INSERT INTO swiss.event_registrations VALUES (36, 915); +INSERT INTO swiss.event_registrations VALUES (36, 914); +INSERT INTO swiss.event_registrations VALUES (36, 913); +INSERT INTO swiss.event_registrations VALUES (36, 912); +INSERT INTO swiss.event_registrations VALUES (36, 879); +INSERT INTO swiss.event_registrations VALUES (36, 878); +INSERT INTO swiss.event_registrations VALUES (36, 877); +INSERT INTO swiss.event_registrations VALUES (36, 876); +INSERT INTO swiss.event_registrations VALUES (36, 875); +INSERT INTO swiss.event_registrations VALUES (36, 874); +INSERT INTO swiss.event_registrations VALUES (36, 872); +INSERT INTO swiss.event_registrations VALUES (36, 1045); +INSERT INTO swiss.event_registrations VALUES (37, 1061); +INSERT INTO swiss.event_registrations VALUES (37, 1060); +INSERT INTO swiss.event_registrations VALUES (37, 1059); +INSERT INTO swiss.event_registrations VALUES (37, 1058); +INSERT INTO swiss.event_registrations VALUES (37, 1057); +INSERT INTO swiss.event_registrations VALUES (37, 1056); +INSERT INTO swiss.event_registrations VALUES (37, 1055); +INSERT INTO swiss.event_registrations VALUES (37, 1054); +INSERT INTO swiss.event_registrations VALUES (37, 1053); +INSERT INTO swiss.event_registrations VALUES (37, 1052); +INSERT INTO swiss.event_registrations VALUES (37, 1051); +INSERT INTO swiss.event_registrations VALUES (37, 1050); +INSERT INTO swiss.event_registrations VALUES (37, 1049); +INSERT INTO swiss.event_registrations VALUES (37, 1048); +INSERT INTO swiss.event_registrations VALUES (37, 1047); +INSERT INTO swiss.event_registrations VALUES (37, 1046); +INSERT INTO swiss.event_registrations VALUES (37, 1042); +INSERT INTO swiss.event_registrations VALUES (37, 1041); +INSERT INTO swiss.event_registrations VALUES (37, 1040); +INSERT INTO swiss.event_registrations VALUES (37, 1039); +INSERT INTO swiss.event_registrations VALUES (37, 1038); +INSERT INTO swiss.event_registrations VALUES (37, 1037); +INSERT INTO swiss.event_registrations VALUES (37, 1036); +INSERT INTO swiss.event_registrations VALUES (37, 1035); +INSERT INTO swiss.event_registrations VALUES (37, 1034); +INSERT INTO swiss.event_registrations VALUES (37, 1033); +INSERT INTO swiss.event_registrations VALUES (37, 1032); +INSERT INTO swiss.event_registrations VALUES (37, 1031); +INSERT INTO swiss.event_registrations VALUES (37, 1030); +INSERT INTO swiss.event_registrations VALUES (37, 1029); +INSERT INTO swiss.event_registrations VALUES (37, 1028); +INSERT INTO swiss.event_registrations VALUES (37, 998); +INSERT INTO swiss.event_registrations VALUES (37, 997); +INSERT INTO swiss.event_registrations VALUES (37, 996); +INSERT INTO swiss.event_registrations VALUES (37, 995); +INSERT INTO swiss.event_registrations VALUES (37, 994); +INSERT INTO swiss.event_registrations VALUES (37, 993); +INSERT INTO swiss.event_registrations VALUES (37, 992); +INSERT INTO swiss.event_registrations VALUES (37, 991); +INSERT INTO swiss.event_registrations VALUES (37, 990); +INSERT INTO swiss.event_registrations VALUES (37, 989); +INSERT INTO swiss.event_registrations VALUES (37, 988); +INSERT INTO swiss.event_registrations VALUES (37, 987); +INSERT INTO swiss.event_registrations VALUES (37, 986); +INSERT INTO swiss.event_registrations VALUES (37, 985); +INSERT INTO swiss.event_registrations VALUES (37, 984); +INSERT INTO swiss.event_registrations VALUES (37, 983); +INSERT INTO swiss.event_registrations VALUES (37, 982); +INSERT INTO swiss.event_registrations VALUES (37, 981); +INSERT INTO swiss.event_registrations VALUES (37, 980); +INSERT INTO swiss.event_registrations VALUES (37, 979); +INSERT INTO swiss.event_registrations VALUES (37, 978); +INSERT INTO swiss.event_registrations VALUES (37, 977); +INSERT INTO swiss.event_registrations VALUES (37, 976); +INSERT INTO swiss.event_registrations VALUES (37, 975); +INSERT INTO swiss.event_registrations VALUES (37, 974); +INSERT INTO swiss.event_registrations VALUES (37, 973); +INSERT INTO swiss.event_registrations VALUES (37, 972); +INSERT INTO swiss.event_registrations VALUES (37, 971); +INSERT INTO swiss.event_registrations VALUES (37, 970); +INSERT INTO swiss.event_registrations VALUES (37, 969); +INSERT INTO swiss.event_registrations VALUES (37, 968); +INSERT INTO swiss.event_registrations VALUES (37, 967); +INSERT INTO swiss.event_registrations VALUES (37, 911); +INSERT INTO swiss.event_registrations VALUES (37, 910); +INSERT INTO swiss.event_registrations VALUES (37, 909); +INSERT INTO swiss.event_registrations VALUES (37, 908); +INSERT INTO swiss.event_registrations VALUES (37, 907); +INSERT INTO swiss.event_registrations VALUES (37, 906); +INSERT INTO swiss.event_registrations VALUES (37, 905); +INSERT INTO swiss.event_registrations VALUES (37, 904); +INSERT INTO swiss.event_registrations VALUES (37, 903); +INSERT INTO swiss.event_registrations VALUES (37, 902); +INSERT INTO swiss.event_registrations VALUES (37, 901); +INSERT INTO swiss.event_registrations VALUES (37, 900); +INSERT INTO swiss.event_registrations VALUES (37, 899); +INSERT INTO swiss.event_registrations VALUES (37, 898); +INSERT INTO swiss.event_registrations VALUES (37, 897); +INSERT INTO swiss.event_registrations VALUES (37, 896); +INSERT INTO swiss.event_registrations VALUES (37, 895); +INSERT INTO swiss.event_registrations VALUES (37, 894); +INSERT INTO swiss.event_registrations VALUES (37, 893); +INSERT INTO swiss.event_registrations VALUES (37, 892); +INSERT INTO swiss.event_registrations VALUES (37, 891); +INSERT INTO swiss.event_registrations VALUES (37, 890); +INSERT INTO swiss.event_registrations VALUES (37, 889); +INSERT INTO swiss.event_registrations VALUES (37, 888); +INSERT INTO swiss.event_registrations VALUES (37, 887); +INSERT INTO swiss.event_registrations VALUES (37, 886); +INSERT INTO swiss.event_registrations VALUES (37, 885); +INSERT INTO swiss.event_registrations VALUES (37, 884); +INSERT INTO swiss.event_registrations VALUES (37, 883); +INSERT INTO swiss.event_registrations VALUES (37, 882); +INSERT INTO swiss.event_registrations VALUES (37, 881); +INSERT INTO swiss.event_registrations VALUES (37, 880); +INSERT INTO swiss.event_registrations VALUES (37, 873); +INSERT INTO swiss.event_registrations VALUES (37, 1062); +INSERT INTO swiss.event_registrations VALUES (38, 1075); +INSERT INTO swiss.event_registrations VALUES (38, 1074); +INSERT INTO swiss.event_registrations VALUES (38, 1073); +INSERT INTO swiss.event_registrations VALUES (38, 1072); +INSERT INTO swiss.event_registrations VALUES (38, 1071); +INSERT INTO swiss.event_registrations VALUES (38, 1070); +INSERT INTO swiss.event_registrations VALUES (38, 1069); +INSERT INTO swiss.event_registrations VALUES (38, 1068); +INSERT INTO swiss.event_registrations VALUES (38, 1067); +INSERT INTO swiss.event_registrations VALUES (38, 1066); +INSERT INTO swiss.event_registrations VALUES (38, 1065); +INSERT INTO swiss.event_registrations VALUES (38, 1064); +INSERT INTO swiss.event_registrations VALUES (38, 1063); +INSERT INTO swiss.event_registrations VALUES (38, 1076); + + +-- +-- TOC entry 3606 (class 0 OID 17227) +-- Dependencies: 259 +-- Data for Name: eventgroup; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.eventgroup VALUES (0, NULL, 8, 'Herenenkel 1', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (0, NULL, 9, 'Herenenkel 2', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (1, NULL, 10, 'Damesenkel 1', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (1, NULL, 11, 'Damesenkel 2', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (0, NULL, 15, 'Herenenkel 1', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (0, NULL, 16, 'Herenenkel 2', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (1, NULL, 17, 'Damesenkel 1', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (1, NULL, 18, 'Damesenkel 2', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (2, 23, 19, 'Herendubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (3, 24, 20, 'Damesdubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (4, 25, 21, 'Gemengd dubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (0, NULL, 22, 'Herenenkel 1', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (0, NULL, 23, 'Herenenkel 2', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (1, NULL, 24, 'Damesenkel 1', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (1, NULL, 25, 'Damesenkel 2', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (2, 23, 26, 'Herendubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (3, 24, 27, 'Damesdubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (4, 25, 28, 'Gemengd dubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (0, 26, 29, 'Herenenkel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (2, 28, 30, 'Herendubbel', 'IN_PROGRESS'); +INSERT INTO swiss.eventgroup VALUES (4, 30, 31, 'Gemengd dubbel', 'IN_PROGRESS'); + + +-- +-- TOC entry 3618 (class 0 OID 17380) +-- Dependencies: 271 +-- Data for Name: eventgroup_rounds; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.eventgroup_rounds VALUES (8, 1); +INSERT INTO swiss.eventgroup_rounds VALUES (10, 3); +INSERT INTO swiss.eventgroup_rounds VALUES (11, 4); +INSERT INTO swiss.eventgroup_rounds VALUES (22, 15); +INSERT INTO swiss.eventgroup_rounds VALUES (23, 16); +INSERT INTO swiss.eventgroup_rounds VALUES (24, 17); +INSERT INTO swiss.eventgroup_rounds VALUES (25, 18); +INSERT INTO swiss.eventgroup_rounds VALUES (26, 19); +INSERT INTO swiss.eventgroup_rounds VALUES (27, 20); +INSERT INTO swiss.eventgroup_rounds VALUES (28, 21); + + +-- +-- TOC entry 3615 (class 0 OID 17348) +-- Dependencies: 268 +-- Data for Name: eventgroup_teams; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.eventgroup_teams VALUES (15, 246); +INSERT INTO swiss.eventgroup_teams VALUES (15, 247); +INSERT INTO swiss.eventgroup_teams VALUES (15, 248); +INSERT INTO swiss.eventgroup_teams VALUES (15, 249); +INSERT INTO swiss.eventgroup_teams VALUES (15, 250); +INSERT INTO swiss.eventgroup_teams VALUES (15, 251); +INSERT INTO swiss.eventgroup_teams VALUES (15, 252); +INSERT INTO swiss.eventgroup_teams VALUES (15, 253); +INSERT INTO swiss.eventgroup_teams VALUES (15, 254); +INSERT INTO swiss.eventgroup_teams VALUES (15, 255); +INSERT INTO swiss.eventgroup_teams VALUES (15, 256); +INSERT INTO swiss.eventgroup_teams VALUES (15, 257); +INSERT INTO swiss.eventgroup_teams VALUES (15, 258); +INSERT INTO swiss.eventgroup_teams VALUES (15, 259); +INSERT INTO swiss.eventgroup_teams VALUES (15, 260); +INSERT INTO swiss.eventgroup_teams VALUES (15, 261); +INSERT INTO swiss.eventgroup_teams VALUES (16, 262); +INSERT INTO swiss.eventgroup_teams VALUES (16, 263); +INSERT INTO swiss.eventgroup_teams VALUES (16, 264); +INSERT INTO swiss.eventgroup_teams VALUES (16, 265); +INSERT INTO swiss.eventgroup_teams VALUES (16, 266); +INSERT INTO swiss.eventgroup_teams VALUES (16, 267); +INSERT INTO swiss.eventgroup_teams VALUES (16, 268); +INSERT INTO swiss.eventgroup_teams VALUES (16, 269); +INSERT INTO swiss.eventgroup_teams VALUES (16, 270); +INSERT INTO swiss.eventgroup_teams VALUES (16, 271); +INSERT INTO swiss.eventgroup_teams VALUES (16, 272); +INSERT INTO swiss.eventgroup_teams VALUES (16, 273); +INSERT INTO swiss.eventgroup_teams VALUES (16, 274); +INSERT INTO swiss.eventgroup_teams VALUES (16, 275); +INSERT INTO swiss.eventgroup_teams VALUES (16, 276); +INSERT INTO swiss.eventgroup_teams VALUES (17, 277); +INSERT INTO swiss.eventgroup_teams VALUES (17, 278); +INSERT INTO swiss.eventgroup_teams VALUES (17, 279); +INSERT INTO swiss.eventgroup_teams VALUES (17, 280); +INSERT INTO swiss.eventgroup_teams VALUES (17, 281); +INSERT INTO swiss.eventgroup_teams VALUES (17, 282); +INSERT INTO swiss.eventgroup_teams VALUES (17, 283); +INSERT INTO swiss.eventgroup_teams VALUES (17, 284); +INSERT INTO swiss.eventgroup_teams VALUES (17, 285); +INSERT INTO swiss.eventgroup_teams VALUES (17, 286); +INSERT INTO swiss.eventgroup_teams VALUES (17, 287); +INSERT INTO swiss.eventgroup_teams VALUES (17, 288); +INSERT INTO swiss.eventgroup_teams VALUES (17, 289); +INSERT INTO swiss.eventgroup_teams VALUES (17, 290); +INSERT INTO swiss.eventgroup_teams VALUES (17, 291); +INSERT INTO swiss.eventgroup_teams VALUES (17, 292); +INSERT INTO swiss.eventgroup_teams VALUES (18, 293); +INSERT INTO swiss.eventgroup_teams VALUES (18, 294); +INSERT INTO swiss.eventgroup_teams VALUES (18, 295); +INSERT INTO swiss.eventgroup_teams VALUES (18, 296); +INSERT INTO swiss.eventgroup_teams VALUES (18, 297); +INSERT INTO swiss.eventgroup_teams VALUES (18, 298); +INSERT INTO swiss.eventgroup_teams VALUES (18, 299); +INSERT INTO swiss.eventgroup_teams VALUES (18, 300); +INSERT INTO swiss.eventgroup_teams VALUES (18, 301); +INSERT INTO swiss.eventgroup_teams VALUES (18, 302); +INSERT INTO swiss.eventgroup_teams VALUES (18, 303); +INSERT INTO swiss.eventgroup_teams VALUES (18, 304); +INSERT INTO swiss.eventgroup_teams VALUES (18, 305); +INSERT INTO swiss.eventgroup_teams VALUES (18, 306); +INSERT INTO swiss.eventgroup_teams VALUES (18, 307); +INSERT INTO swiss.eventgroup_teams VALUES (18, 308); +INSERT INTO swiss.eventgroup_teams VALUES (19, 309); +INSERT INTO swiss.eventgroup_teams VALUES (19, 310); +INSERT INTO swiss.eventgroup_teams VALUES (19, 311); +INSERT INTO swiss.eventgroup_teams VALUES (19, 312); +INSERT INTO swiss.eventgroup_teams VALUES (19, 313); +INSERT INTO swiss.eventgroup_teams VALUES (19, 314); +INSERT INTO swiss.eventgroup_teams VALUES (19, 315); +INSERT INTO swiss.eventgroup_teams VALUES (20, 316); +INSERT INTO swiss.eventgroup_teams VALUES (20, 317); +INSERT INTO swiss.eventgroup_teams VALUES (20, 318); +INSERT INTO swiss.eventgroup_teams VALUES (20, 319); +INSERT INTO swiss.eventgroup_teams VALUES (20, 320); +INSERT INTO swiss.eventgroup_teams VALUES (20, 321); +INSERT INTO swiss.eventgroup_teams VALUES (20, 322); +INSERT INTO swiss.eventgroup_teams VALUES (20, 323); +INSERT INTO swiss.eventgroup_teams VALUES (20, 324); +INSERT INTO swiss.eventgroup_teams VALUES (21, 325); +INSERT INTO swiss.eventgroup_teams VALUES (21, 326); +INSERT INTO swiss.eventgroup_teams VALUES (21, 327); +INSERT INTO swiss.eventgroup_teams VALUES (21, 328); +INSERT INTO swiss.eventgroup_teams VALUES (21, 329); +INSERT INTO swiss.eventgroup_teams VALUES (21, 330); +INSERT INTO swiss.eventgroup_teams VALUES (21, 331); +INSERT INTO swiss.eventgroup_teams VALUES (21, 332); +INSERT INTO swiss.eventgroup_teams VALUES (21, 333); +INSERT INTO swiss.eventgroup_teams VALUES (21, 334); +INSERT INTO swiss.eventgroup_teams VALUES (21, 335); +INSERT INTO swiss.eventgroup_teams VALUES (21, 336); +INSERT INTO swiss.eventgroup_teams VALUES (22, 337); +INSERT INTO swiss.eventgroup_teams VALUES (22, 338); +INSERT INTO swiss.eventgroup_teams VALUES (22, 339); +INSERT INTO swiss.eventgroup_teams VALUES (22, 340); +INSERT INTO swiss.eventgroup_teams VALUES (22, 341); +INSERT INTO swiss.eventgroup_teams VALUES (22, 342); +INSERT INTO swiss.eventgroup_teams VALUES (22, 343); +INSERT INTO swiss.eventgroup_teams VALUES (22, 344); +INSERT INTO swiss.eventgroup_teams VALUES (22, 345); +INSERT INTO swiss.eventgroup_teams VALUES (22, 346); +INSERT INTO swiss.eventgroup_teams VALUES (22, 347); +INSERT INTO swiss.eventgroup_teams VALUES (22, 348); +INSERT INTO swiss.eventgroup_teams VALUES (22, 349); +INSERT INTO swiss.eventgroup_teams VALUES (22, 350); +INSERT INTO swiss.eventgroup_teams VALUES (22, 351); +INSERT INTO swiss.eventgroup_teams VALUES (22, 352); +INSERT INTO swiss.eventgroup_teams VALUES (23, 353); +INSERT INTO swiss.eventgroup_teams VALUES (23, 354); +INSERT INTO swiss.eventgroup_teams VALUES (23, 355); +INSERT INTO swiss.eventgroup_teams VALUES (23, 356); +INSERT INTO swiss.eventgroup_teams VALUES (23, 357); +INSERT INTO swiss.eventgroup_teams VALUES (23, 358); +INSERT INTO swiss.eventgroup_teams VALUES (23, 359); +INSERT INTO swiss.eventgroup_teams VALUES (23, 360); +INSERT INTO swiss.eventgroup_teams VALUES (23, 361); +INSERT INTO swiss.eventgroup_teams VALUES (23, 362); +INSERT INTO swiss.eventgroup_teams VALUES (23, 363); +INSERT INTO swiss.eventgroup_teams VALUES (23, 364); +INSERT INTO swiss.eventgroup_teams VALUES (23, 365); +INSERT INTO swiss.eventgroup_teams VALUES (23, 366); +INSERT INTO swiss.eventgroup_teams VALUES (23, 367); +INSERT INTO swiss.eventgroup_teams VALUES (24, 368); +INSERT INTO swiss.eventgroup_teams VALUES (24, 369); +INSERT INTO swiss.eventgroup_teams VALUES (24, 370); +INSERT INTO swiss.eventgroup_teams VALUES (24, 371); +INSERT INTO swiss.eventgroup_teams VALUES (24, 372); +INSERT INTO swiss.eventgroup_teams VALUES (24, 373); +INSERT INTO swiss.eventgroup_teams VALUES (24, 374); +INSERT INTO swiss.eventgroup_teams VALUES (24, 375); +INSERT INTO swiss.eventgroup_teams VALUES (24, 376); +INSERT INTO swiss.eventgroup_teams VALUES (24, 377); +INSERT INTO swiss.eventgroup_teams VALUES (24, 378); +INSERT INTO swiss.eventgroup_teams VALUES (24, 379); +INSERT INTO swiss.eventgroup_teams VALUES (24, 380); +INSERT INTO swiss.eventgroup_teams VALUES (24, 381); +INSERT INTO swiss.eventgroup_teams VALUES (24, 382); +INSERT INTO swiss.eventgroup_teams VALUES (24, 383); +INSERT INTO swiss.eventgroup_teams VALUES (25, 384); +INSERT INTO swiss.eventgroup_teams VALUES (25, 385); +INSERT INTO swiss.eventgroup_teams VALUES (25, 386); +INSERT INTO swiss.eventgroup_teams VALUES (25, 387); +INSERT INTO swiss.eventgroup_teams VALUES (25, 388); +INSERT INTO swiss.eventgroup_teams VALUES (25, 389); +INSERT INTO swiss.eventgroup_teams VALUES (25, 390); +INSERT INTO swiss.eventgroup_teams VALUES (25, 391); +INSERT INTO swiss.eventgroup_teams VALUES (25, 392); +INSERT INTO swiss.eventgroup_teams VALUES (25, 393); +INSERT INTO swiss.eventgroup_teams VALUES (25, 394); +INSERT INTO swiss.eventgroup_teams VALUES (25, 395); +INSERT INTO swiss.eventgroup_teams VALUES (25, 396); +INSERT INTO swiss.eventgroup_teams VALUES (25, 397); +INSERT INTO swiss.eventgroup_teams VALUES (25, 398); +INSERT INTO swiss.eventgroup_teams VALUES (25, 399); +INSERT INTO swiss.eventgroup_teams VALUES (26, 400); +INSERT INTO swiss.eventgroup_teams VALUES (26, 401); +INSERT INTO swiss.eventgroup_teams VALUES (26, 402); +INSERT INTO swiss.eventgroup_teams VALUES (26, 403); +INSERT INTO swiss.eventgroup_teams VALUES (26, 404); +INSERT INTO swiss.eventgroup_teams VALUES (26, 405); +INSERT INTO swiss.eventgroup_teams VALUES (26, 406); +INSERT INTO swiss.eventgroup_teams VALUES (27, 407); +INSERT INTO swiss.eventgroup_teams VALUES (27, 408); +INSERT INTO swiss.eventgroup_teams VALUES (27, 409); +INSERT INTO swiss.eventgroup_teams VALUES (27, 410); +INSERT INTO swiss.eventgroup_teams VALUES (27, 411); +INSERT INTO swiss.eventgroup_teams VALUES (27, 412); +INSERT INTO swiss.eventgroup_teams VALUES (27, 413); +INSERT INTO swiss.eventgroup_teams VALUES (27, 414); +INSERT INTO swiss.eventgroup_teams VALUES (27, 415); +INSERT INTO swiss.eventgroup_teams VALUES (28, 416); +INSERT INTO swiss.eventgroup_teams VALUES (28, 417); +INSERT INTO swiss.eventgroup_teams VALUES (28, 418); +INSERT INTO swiss.eventgroup_teams VALUES (28, 419); +INSERT INTO swiss.eventgroup_teams VALUES (28, 420); +INSERT INTO swiss.eventgroup_teams VALUES (28, 421); +INSERT INTO swiss.eventgroup_teams VALUES (28, 422); +INSERT INTO swiss.eventgroup_teams VALUES (28, 423); +INSERT INTO swiss.eventgroup_teams VALUES (28, 424); +INSERT INTO swiss.eventgroup_teams VALUES (28, 425); +INSERT INTO swiss.eventgroup_teams VALUES (28, 426); +INSERT INTO swiss.eventgroup_teams VALUES (28, 427); +INSERT INTO swiss.eventgroup_teams VALUES (29, 428); +INSERT INTO swiss.eventgroup_teams VALUES (29, 429); +INSERT INTO swiss.eventgroup_teams VALUES (29, 430); +INSERT INTO swiss.eventgroup_teams VALUES (29, 431); +INSERT INTO swiss.eventgroup_teams VALUES (30, 432); +INSERT INTO swiss.eventgroup_teams VALUES (30, 433); +INSERT INTO swiss.eventgroup_teams VALUES (30, 434); +INSERT INTO swiss.eventgroup_teams VALUES (30, 435); +INSERT INTO swiss.eventgroup_teams VALUES (30, 436); +INSERT INTO swiss.eventgroup_teams VALUES (31, 437); +INSERT INTO swiss.eventgroup_teams VALUES (31, 438); +INSERT INTO swiss.eventgroup_teams VALUES (31, 439); +INSERT INTO swiss.eventgroup_teams VALUES (31, 440); + + +-- +-- TOC entry 3598 (class 0 OID 17183) +-- Dependencies: 251 +-- Data for Name: flyway_schema_history; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.flyway_schema_history VALUES (1, '1', 'init', 'SQL', 'V1__init.sql', 2080519899, 'swiss-user', '2024-10-03 10:35:39.763959', 127, true); + + +-- +-- TOC entry 3622 (class 0 OID 17419) +-- Dependencies: 275 +-- Data for Name: game; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + + + +-- +-- TOC entry 3620 (class 0 OID 17396) +-- Dependencies: 273 +-- Data for Name: match; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 45, 8, NULL, 346, 345); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 46, 8, NULL, 347, 350); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 47, 8, NULL, 348, 337); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 48, 8, NULL, 343, 352); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 49, 8, NULL, 342, 344); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 50, 8, NULL, 339, 340); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 51, 8, NULL, 338, 351); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 52, 8, NULL, 341, 349); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 53, 9, NULL, 361, 360); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 54, 9, NULL, 367, 358); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 55, 9, NULL, 363, 362); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 56, 9, NULL, 364, 354); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 57, 9, NULL, 365, 357); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 58, 9, NULL, 366, 356); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 59, 9, NULL, 355, 353); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 60, 10, NULL, 378, 375); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 61, 10, NULL, 369, 376); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 62, 10, NULL, 379, 372); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 63, 10, NULL, 371, 381); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 64, 10, NULL, 382, 373); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 65, 10, NULL, 380, 383); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 66, 10, NULL, 370, 374); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 67, 10, NULL, 368, 377); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 68, 11, NULL, 399, 389); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 69, 11, NULL, 396, 391); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 70, 11, NULL, 384, 385); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 71, 11, NULL, 386, 397); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 72, 11, NULL, 388, 387); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 73, 11, NULL, 395, 392); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 74, 11, NULL, 390, 394); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 75, 11, NULL, 398, 393); +INSERT INTO swiss.match VALUES (false, 0, 2, NULL, NULL, 76, 12, NULL, 401, 402); +INSERT INTO swiss.match VALUES (false, 0, 2, NULL, NULL, 77, 12, NULL, 400, 403); +INSERT INTO swiss.match VALUES (false, 0, 2, NULL, NULL, 78, 12, NULL, 405, 406); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 79, 13, NULL, 408, 412); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 80, 13, NULL, 410, 407); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 81, 13, NULL, 413, 414); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 82, 13, NULL, 415, 409); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 83, 14, NULL, 427, 426); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 84, 14, NULL, 416, 423); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 85, 14, NULL, 421, 424); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 86, 14, NULL, 422, 425); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 87, 14, NULL, 418, 417); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 88, 14, NULL, 420, 419); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 89, 15, NULL, 344, 348); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 90, 15, NULL, 345, 343); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 91, 15, NULL, 342, 347); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 92, 15, NULL, 340, 349); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 93, 15, NULL, 341, 346); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 94, 15, NULL, 337, 352); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 95, 15, NULL, 351, 350); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 96, 15, NULL, 339, 338); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 97, 16, NULL, 356, 360); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 98, 16, NULL, 361, 364); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 99, 16, NULL, 357, 358); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 100, 16, NULL, 365, 367); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 101, 16, NULL, 354, 359); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 102, 16, NULL, 362, 366); +INSERT INTO swiss.match VALUES (false, 0, 0, NULL, NULL, 103, 16, NULL, 355, 363); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 104, 17, NULL, 368, 371); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 105, 17, NULL, 370, 372); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 106, 17, NULL, 380, 382); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 107, 17, NULL, 369, 381); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 108, 17, NULL, 377, 374); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 109, 17, NULL, 383, 379); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 110, 17, NULL, 373, 375); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 111, 17, NULL, 376, 378); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 112, 18, NULL, 385, 384); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 113, 18, NULL, 397, 394); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 114, 18, NULL, 398, 396); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 115, 18, NULL, 389, 395); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 116, 18, NULL, 387, 391); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 117, 18, NULL, 392, 393); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 118, 18, NULL, 390, 388); +INSERT INTO swiss.match VALUES (false, 0, 1, NULL, NULL, 119, 18, NULL, 386, 399); +INSERT INTO swiss.match VALUES (false, 0, 2, NULL, NULL, 120, 19, NULL, 400, 406); +INSERT INTO swiss.match VALUES (false, 0, 2, NULL, NULL, 121, 19, NULL, 401, 402); +INSERT INTO swiss.match VALUES (false, 0, 2, NULL, NULL, 122, 19, NULL, 405, 403); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 123, 20, NULL, 414, 408); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 124, 20, NULL, 413, 411); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 125, 20, NULL, 415, 412); +INSERT INTO swiss.match VALUES (false, 0, 3, NULL, NULL, 126, 20, NULL, 409, 410); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 127, 21, NULL, 416, 421); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 128, 21, NULL, 422, 417); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 129, 21, NULL, 420, 425); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 130, 21, NULL, 426, 418); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 131, 21, NULL, 423, 419); +INSERT INTO swiss.match VALUES (false, 0, 4, NULL, NULL, 132, 21, NULL, 424, 427); + + +-- +-- TOC entry 3623 (class 0 OID 17429) +-- Dependencies: 276 +-- Data for Name: match_games; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + + + +-- +-- TOC entry 3600 (class 0 OID 17193) +-- Dependencies: 253 +-- Data for Name: player; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.player VALUES ('0101-05-12', 316, 'BCH', 'bch1@bch.nl', 'bch1', 'bch1', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('0101-05-12', 317, 'BCH', 'bch1@bch.nl', 'tess', 'koemans', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1999-09-23', 322, 'ELO United', 'aaaa@bbb.cc', 'Jeffrey', 'Rakhorst', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('2006-11-05', 331, 'ZBC', 'aaaa@bbb.cc', 'Guido', 'Keizer', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1963-05-07', 340, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Gerben', 'Duursma', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('2009-05-31', 346, 'BC Kwiek', 'aaaa@bbb.cc', 'Gert', 'Keizer', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1955-06-15', 347, 'BC Holten', 'aaaa@bbb.cc', 'Dennis', 'Ebbers', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1957-08-04', 348, 'BC Holten', 'aaaa@bbb.cc', 'Pieter', 'Verschoor', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('2000-09-01', 349, 'Flits', 'aaaa@bbb.cc', 'Amber', 'Ebbers', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1950-05-19', 350, 'ELO United', 'aaaa@bbb.cc', 'Lisa', 'Koers', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1950-01-02', 351, 'BC Kwiek', 'aaaa@bbb.cc', 'Vanja', 'Koers', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1967-03-08', 352, 'BC Holten', 'aaaa@bbb.cc', 'Evelien', 'Lensink', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('1955-09-13', 353, 'BC Kwiek', 'aaaa@bbb.cc', 'Daphne', 'Rakhorst', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('2001-02-03', 354, 'BC Holten', 'aaaa@bbb.cc', 'Willemijn', 'Goedhart', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1955-07-08', 355, 'BC IJsselstad', 'aaaa@bbb.cc', 'Miranda', 'Rakhorst', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('2000-09-03', 356, 'BC Holten', 'aaaa@bbb.cc', 'Inge', 'Brehler', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1973-07-15', 357, 'BC IJsselstad', 'aaaa@bbb.cc', 'Esmee', 'Ebbers', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1964-10-17', 358, 'Flits', 'aaaa@bbb.cc', 'Joanne', 'Verschoor', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1984-08-18', 359, 'Flits', 'aaaa@bbb.cc', 'Laura', 'Koers', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('1975-03-24', 360, 'BC IJsselstad', 'aaaa@bbb.cc', 'Nienke', 'Coemans', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1999-11-14', 361, 'BC IJsselstad', 'aaaa@bbb.cc', 'Patty', 'Brehler', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('2001-05-02', 362, 'BC Holten', 'aaaa@bbb.cc', 'Rosan', 'Kelder', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1958-08-18', 363, 'BC IJsselstad', 'aaaa@bbb.cc', 'Vera', 'Keizer', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1973-12-27', 364, 'ZBC', 'aaaa@bbb.cc', 'Hedwig', 'Koers', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('2008-02-08', 365, 'BC Kwiek', 'aaaa@bbb.cc', 'Lois', 'Gijsman', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1968-02-29', 366, 'ZBC', 'aaaa@bbb.cc', 'Liedewij', 'Lups', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1967-12-05', 367, 'Flits', 'aaaa@bbb.cc', 'Gera', 'Castelein', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1959-08-28', 368, 'ELO United', 'aaaa@bbb.cc', 'Carolien', 'Seinen', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('2005-02-20', 369, 'BC Holten', 'aaaa@bbb.cc', 'Anne', 'Rakhorst', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1972-05-23', 370, 'Flits', 'aaaa@bbb.cc', 'Dominique', 'Zijlma', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1970-01-20', 371, 'BC Reflex', 'aaaa@bbb.cc', 'Linda', 'Mulder', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1999-07-01', 372, 'BC Kwiek', 'aaaa@bbb.cc', 'Esther', 'Verschoor', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1953-08-28', 373, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Marilyn', 'Mayer', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1955-07-13', 374, 'BC Holten', 'aaaa@bbb.cc', 'Ilse', 'Westerik', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('2001-02-18', 375, 'ELO United', 'aaaa@bbb.cc', 'Emily', 'Stein', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1965-10-27', 376, 'Flits', 'aaaa@bbb.cc', 'Eva', 'Coemans', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('2006-11-13', 377, 'Flits', 'aaaa@bbb.cc', 'Kitty', 'Ebbers', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1981-06-07', 378, 'BC IJsselstad', 'aaaa@bbb.cc', 'Floor', 'Rakhorst', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1978-09-10', 379, 'Flits', 'aaaa@bbb.cc', 'Tess', 'Huijbers', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1984-06-10', 380, 'BC Holten', 'aaaa@bbb.cc', 'Fenna', 'Brugman', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1999-01-17', 381, 'BC Kwiek', 'aaaa@bbb.cc', 'Michel', 'Rakhorst', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1979-02-09', 382, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Eric', 'Gijsman', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1956-11-28', 383, 'BC IJsselstad', 'aaaa@bbb.cc', 'Leon', 'Duursma', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('2001-01-10', 384, 'BC IJsselstad', 'aaaa@bbb.cc', 'Luuk', 'Lups', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('2007-01-14', 385, 'ELO United', 'aaaa@bbb.cc', 'Jeffrey', 'Seinen', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1999-05-21', 386, 'BC Holten', 'aaaa@bbb.cc', 'Jason', 'Mulder', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1994-01-09', 387, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Oleg', 'Rakhorst', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('2002-10-19', 388, 'BC Holten', 'aaaa@bbb.cc', 'Gerjan', 'Coemans', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1985-10-24', 389, 'ZBC', 'aaaa@bbb.cc', 'Gerard', 'Mulder', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('2003-11-04', 390, 'BC Reflex', 'aaaa@bbb.cc', 'Henk', 'Lensink', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1988-09-25', 391, 'BC Reflex', 'aaaa@bbb.cc', 'Peter', 'Kelder', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1972-06-06', 392, 'BC Reflex', 'aaaa@bbb.cc', 'Gerrit', 'Kelder', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1953-11-18', 393, 'BC Kwiek', 'aaaa@bbb.cc', 'Wilco', 'Lensink', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1958-05-29', 394, 'ELO United', 'aaaa@bbb.cc', 'Guido', 'Huijbers', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('2003-09-06', 395, 'ZBC', 'aaaa@bbb.cc', 'Sander', 'Lups', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1977-07-06', 396, 'ELO United', 'aaaa@bbb.cc', 'Roy', 'Verschoor', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1950-05-07', 397, 'ZBC', 'aaaa@bbb.cc', 'Yafiq', 'Mayer', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1982-10-05', 398, 'ELO United', 'aaaa@bbb.cc', 'Martijn', 'Koers', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1973-06-22', 399, 'ZBC', 'aaaa@bbb.cc', 'Dick', 'Koers', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1975-07-02', 400, 'ZBC', 'aaaa@bbb.cc', 'Willem', 'Coemans', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1985-06-25', 401, 'ELO United', 'aaaa@bbb.cc', 'Layo', 'Kelder', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1977-02-03', 402, 'BC IJsselstad', 'aaaa@bbb.cc', 'Thomas', 'Goedhart', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1990-01-09', 403, 'BC Kwiek', 'aaaa@bbb.cc', 'Gerben', 'Castelein', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1965-10-26', 253, 'BC Kwiek', 'aaaa@bbb.cc', 'Michel', 'Zijlma', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1954-04-18', 254, 'BC Holten', 'aaaa@bbb.cc', 'Eric', 'Mulder', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('2004-04-23', 255, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Leon', 'Holstege', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1950-12-22', 256, 'BC Kwiek', 'aaaa@bbb.cc', 'Luuk', 'Castelein', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1973-11-24', 257, 'ELO United', 'aaaa@bbb.cc', 'Jeffrey', 'Brehler', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1974-05-19', 258, 'BC IJsselstad', 'aaaa@bbb.cc', 'Jason', 'Lups', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1982-05-12', 259, 'BC IJsselstad', 'aaaa@bbb.cc', 'Oleg', 'Seinen', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('2002-03-20', 260, 'BC Reflex', 'aaaa@bbb.cc', 'Gerjan', 'Seinen', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1950-06-23', 261, 'ELO United', 'aaaa@bbb.cc', 'Gerard', 'Stein', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1962-08-17', 262, 'ZBC', 'aaaa@bbb.cc', 'Henk', 'Keizer', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1968-04-23', 263, 'BC Kwiek', 'aaaa@bbb.cc', 'Peter', 'Seinen', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1974-09-20', 264, 'ELO United', 'aaaa@bbb.cc', 'Gerrit', 'Jansen', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1985-04-23', 404, 'ZBC', 'aaaa@bbb.cc', 'Bert', 'Kingma', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1968-08-24', 265, 'BC IJsselstad', 'aaaa@bbb.cc', 'Wilco', 'Rakhorst', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1951-10-13', 266, 'BC Reflex', 'aaaa@bbb.cc', 'Guido', 'Koers', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1960-07-20', 267, 'ELO United', 'aaaa@bbb.cc', 'Sander', 'Duursma', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1976-06-27', 268, 'ZBC', 'aaaa@bbb.cc', 'Roy', 'Huijbers', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1998-08-21', 269, 'ZBC', 'aaaa@bbb.cc', 'Yafiq', 'Keizer', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1984-10-01', 270, 'BC Reflex', 'aaaa@bbb.cc', 'Martijn', 'Huijbers', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1969-05-01', 271, 'BC Kwiek', 'aaaa@bbb.cc', 'Dick', 'Mulder', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1980-02-17', 272, 'Flits', 'aaaa@bbb.cc', 'Willem', 'Ebbers', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1969-09-26', 273, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Layo', 'Stein', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1962-08-20', 274, 'BC Reflex', 'aaaa@bbb.cc', 'Thomas', 'Goedhart', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('2002-02-21', 275, 'ELO United', 'aaaa@bbb.cc', 'Gerben', 'Duindam', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1963-08-19', 276, 'BC Reflex', 'aaaa@bbb.cc', 'Bert', 'Lups', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('2004-10-27', 277, 'ELO United', 'aaaa@bbb.cc', 'Bart', 'Mulder', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1999-03-02', 278, 'BC Kwiek', 'aaaa@bbb.cc', 'Nico', 'Holstege', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1976-04-23', 279, 'ELO United', 'aaaa@bbb.cc', 'Jan', 'Rakhorst', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1978-05-19', 280, 'Flits', 'aaaa@bbb.cc', 'Diederik', 'Holstege', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1969-02-12', 281, 'Flits', 'aaaa@bbb.cc', 'Gert', 'Ebbers', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1951-09-09', 282, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Dennis', 'Holstege', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1961-01-17', 283, 'BC Reflex', 'aaaa@bbb.cc', 'Pieter', 'Duindam', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1991-04-16', 284, 'ELO United', 'aaaa@bbb.cc', 'Amber', 'Westerik', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1956-01-18', 285, 'ZBC', 'aaaa@bbb.cc', 'Lisa', 'Coemans', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1977-10-22', 286, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Vanja', 'Stein', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1965-12-24', 287, 'Flits', 'aaaa@bbb.cc', 'Evelien', 'Verschoor', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1991-06-04', 288, 'ELO United', 'aaaa@bbb.cc', 'Daphne', 'Zijlma', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1981-04-20', 289, 'BC Reflex', 'aaaa@bbb.cc', 'Willemijn', 'Huijbers', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1960-10-05', 290, 'ELO United', 'aaaa@bbb.cc', 'Miranda', 'Duursma', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1960-05-22', 291, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Inge', 'Mulder', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1966-08-01', 292, 'BC Reflex', 'aaaa@bbb.cc', 'Esmee', 'Keizer', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1959-05-21', 293, 'BC IJsselstad', 'aaaa@bbb.cc', 'Joanne', 'Jansen', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1966-05-08', 294, 'BC IJsselstad', 'aaaa@bbb.cc', 'Laura', 'Lups', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1986-04-29', 295, 'BC Kwiek', 'aaaa@bbb.cc', 'Nienke', 'Castelein', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1958-08-24', 296, 'ELO United', 'aaaa@bbb.cc', 'Patty', 'Verschoor', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1972-07-24', 297, 'BC Reflex', 'aaaa@bbb.cc', 'Rosan', 'Coemans', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('2007-11-15', 298, 'BC IJsselstad', 'aaaa@bbb.cc', 'Vera', 'Koers', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1961-05-01', 299, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Hedwig', 'Huijbers', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1995-11-04', 300, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Lois', 'Lensink', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1971-11-21', 301, 'BC IJsselstad', 'aaaa@bbb.cc', 'Liedewij', 'Brugman', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1980-03-29', 302, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Gera', 'Kingma', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1999-04-15', 303, 'BC Kwiek', 'aaaa@bbb.cc', 'Carolien', 'Huijbers', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1996-07-28', 304, 'BC IJsselstad', 'aaaa@bbb.cc', 'Anne', 'Meedendorp', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1956-01-09', 305, 'BC Holten', 'aaaa@bbb.cc', 'Dominique', 'Brugman', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1963-10-29', 306, 'BC IJsselstad', 'aaaa@bbb.cc', 'Linda', 'Mayer', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1959-09-01', 307, 'BC Holten', 'aaaa@bbb.cc', 'Esther', 'Jansen', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1996-01-15', 308, 'ELO United', 'aaaa@bbb.cc', 'Marilyn', 'Westerik', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1992-12-12', 309, 'ELO United', 'aaaa@bbb.cc', 'Ilse', 'Kingma', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1969-02-02', 310, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Emily', 'Keizer', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1981-01-26', 311, 'BC IJsselstad', 'aaaa@bbb.cc', 'Eva', 'Mulder', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('1952-07-29', 312, 'BC Holten', 'aaaa@bbb.cc', 'Kitty', 'Lups', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1952-07-08', 313, 'BC Kwiek', 'aaaa@bbb.cc', 'Floor', 'Kingma', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1962-01-27', 314, 'BC IJsselstad', 'aaaa@bbb.cc', 'Tess', 'Coemans', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1966-03-30', 315, 'ELO United', 'aaaa@bbb.cc', 'Fenna', 'Kingma', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1970-02-09', 318, 'ZBC', 'aaaa@bbb.cc', 'Michel', 'Seinen', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1968-01-26', 319, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Eric', 'Goedhart', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1964-08-01', 320, 'BC Reflex', 'aaaa@bbb.cc', 'Leon', 'Jansen', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1981-05-26', 321, 'BC Kwiek', 'aaaa@bbb.cc', 'Luuk', 'Mayer', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1958-07-10', 323, 'ZBC', 'aaaa@bbb.cc', 'Jason', 'Holstege', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1977-04-14', 324, 'Flits', 'aaaa@bbb.cc', 'Oleg', 'Meedendorp', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1993-06-23', 325, 'BC Holten', 'aaaa@bbb.cc', 'Gerjan', 'Mulder', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1951-06-07', 326, 'Flits', 'aaaa@bbb.cc', 'Gerard', 'Duindam', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1951-11-08', 327, 'ELO United', 'aaaa@bbb.cc', 'Henk', 'Meedendorp', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1978-03-19', 328, 'BC Reflex', 'aaaa@bbb.cc', 'Peter', 'Castelein', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1986-05-15', 329, 'BC IJsselstad', 'aaaa@bbb.cc', 'Gerrit', 'Brugman', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1985-01-10', 330, 'Flits', 'aaaa@bbb.cc', 'Wilco', 'Meedendorp', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1984-05-09', 332, 'ZBC', 'aaaa@bbb.cc', 'Sander', 'Goedhart', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1969-10-28', 333, 'ZBC', 'aaaa@bbb.cc', 'Roy', 'Huijbers', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1951-05-29', 334, 'ELO United', 'aaaa@bbb.cc', 'Yafiq', 'Goedhart', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1964-03-11', 335, 'BC Holten', 'aaaa@bbb.cc', 'Martijn', 'Stein', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1992-08-31', 336, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Dick', 'Duursma', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('1961-03-11', 337, 'BC Reflex', 'aaaa@bbb.cc', 'Willem', 'Mulder', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1993-05-14', 338, 'ZBC', 'aaaa@bbb.cc', 'Layo', 'Lensink', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1978-03-16', 339, 'ELO United', 'aaaa@bbb.cc', 'Thomas', 'Kingma', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1954-12-17', 341, 'ZBC', 'aaaa@bbb.cc', 'Bert', 'Westerik', NULL, '0612345678', 'M', 'D5'); +INSERT INTO swiss.player VALUES ('1970-01-19', 342, 'Flits', 'aaaa@bbb.cc', 'Bart', 'Lensink', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1994-08-24', 343, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Nico', 'Castelein', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1961-10-09', 344, 'ZBC', 'aaaa@bbb.cc', 'Jan', 'Mulder', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('2005-12-04', 345, 'BC Kwiek', 'aaaa@bbb.cc', 'Diederik', 'Duindam', NULL, '0612345678', 'M', 'D9'); +INSERT INTO swiss.player VALUES ('1968-07-30', 405, 'BC Holten', 'aaaa@bbb.cc', 'Bart', 'Jansen', NULL, '0612345678', 'M', 'D6'); +INSERT INTO swiss.player VALUES ('1960-07-23', 407, 'BC Holten', 'aaaa@bbb.cc', 'Jan', 'Castelein', NULL, '0612345678', 'M', 'DR'); +INSERT INTO swiss.player VALUES ('2004-03-11', 408, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Diederik', 'Mayer', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1993-06-19', 411, 'BC Holten', 'aaaa@bbb.cc', 'Pieter', 'Verboom', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1986-05-27', 414, 'BC Kwiek', 'aaaa@bbb.cc', 'Vanja', 'Huijbers', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1969-02-20', 416, 'BC Holten', 'aaaa@bbb.cc', 'Daphne', 'Mulder', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1988-11-18', 417, 'BC Holten', 'aaaa@bbb.cc', 'Willemijn', 'Mulder', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1980-04-06', 418, 'ZBC', 'aaaa@bbb.cc', 'Miranda', 'Mulder', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('1996-06-05', 419, 'BC IJsselstad', 'aaaa@bbb.cc', 'Inge', 'Westerik', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1969-12-25', 422, 'ELO United', 'aaaa@bbb.cc', 'Laura', 'Verboom', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1999-12-25', 425, 'Flits', 'aaaa@bbb.cc', 'Rosan', 'Ebbers', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1976-09-27', 427, 'ZBC', 'aaaa@bbb.cc', 'Hedwig', 'Stein', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1997-08-12', 428, 'ZBC', 'aaaa@bbb.cc', 'Lois', 'Brugman', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1994-09-19', 431, 'BC Kwiek', 'aaaa@bbb.cc', 'Carolien', 'Verschoor', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1990-04-19', 434, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Linda', 'Brehler', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('1978-06-01', 436, 'Flits', 'aaaa@bbb.cc', 'Marilyn', 'Lups', NULL, '0612345678', 'V', 'DR'); +INSERT INTO swiss.player VALUES ('2002-01-15', 437, 'BC Holten', 'aaaa@bbb.cc', 'Ilse', 'Koers', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('2005-06-09', 440, 'BC Reflex', 'aaaa@bbb.cc', 'Kitty', 'Westerik', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('2004-04-04', 443, 'BC Reflex', 'aaaa@bbb.cc', 'Fenna', 'Meedendorp', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1970-06-23', 406, 'ZBC', 'aaaa@bbb.cc', 'Nico', 'Castelein', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('2004-05-12', 409, 'BC Holten', 'aaaa@bbb.cc', 'Gert', 'Castelein', NULL, '0612345678', 'M', 'D8'); +INSERT INTO swiss.player VALUES ('1960-03-24', 410, 'BC Kwiek', 'aaaa@bbb.cc', 'Dennis', 'Goedhart', NULL, '0612345678', 'M', 'D7'); +INSERT INTO swiss.player VALUES ('1975-05-08', 415, 'ZBC', 'aaaa@bbb.cc', 'Evelien', 'Verschoor', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1992-05-03', 420, 'BC Holten', 'aaaa@bbb.cc', 'Esmee', 'Mulder', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1961-01-17', 421, 'BC Holten', 'aaaa@bbb.cc', 'Joanne', 'Brugman', NULL, '0612345678', 'V', 'D8'); +INSERT INTO swiss.player VALUES ('1960-03-31', 426, 'BC Reflex', 'aaaa@bbb.cc', 'Vera', 'Zijlma', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1971-02-24', 429, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Liedewij', 'Stein', NULL, '0612345678', 'V', 'D7'); +INSERT INTO swiss.player VALUES ('1968-06-14', 430, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Gera', 'Lups', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1958-03-29', 435, 'BC Kwiek', 'aaaa@bbb.cc', 'Esther', 'Mayer', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1969-07-31', 438, 'WSV Apeldoorn', 'aaaa@bbb.cc', 'Emily', 'Seinen', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1960-05-06', 439, 'ELO United', 'aaaa@bbb.cc', 'Eva', 'Ebbers', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1977-04-28', 412, 'BC Reflex', 'aaaa@bbb.cc', 'Amber', 'Duindam', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('1986-11-09', 413, 'BC Reflex', 'aaaa@bbb.cc', 'Lisa', 'Stein', NULL, '0612345678', 'V', 'D5'); +INSERT INTO swiss.player VALUES ('1991-07-30', 423, 'BC Holten', 'aaaa@bbb.cc', 'Nienke', 'Zijlma', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1994-07-11', 424, 'BC Kwiek', 'aaaa@bbb.cc', 'Patty', 'Stein', NULL, '0612345678', 'V', 'D6'); +INSERT INTO swiss.player VALUES ('2001-06-18', 432, 'ELO United', 'aaaa@bbb.cc', 'Anne', 'Keizer', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1994-03-23', 433, 'BC Reflex', 'aaaa@bbb.cc', 'Dominique', 'Brehler', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1994-04-17', 441, 'ELO United', 'aaaa@bbb.cc', 'Floor', 'Keizer', NULL, '0612345678', 'V', 'D9'); +INSERT INTO swiss.player VALUES ('1972-12-08', 442, 'Flits', 'aaaa@bbb.cc', 'Tess', 'Kelder', NULL, '0612345678', 'V', 'D7'); + + +-- +-- TOC entry 3611 (class 0 OID 17297) +-- Dependencies: 264 +-- Data for Name: player_partner_registrations; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + + + +-- +-- TOC entry 3612 (class 0 OID 17312) +-- Dependencies: 265 +-- Data for Name: player_registrations; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + + + +-- +-- TOC entry 3609 (class 0 OID 17257) +-- Dependencies: 262 +-- Data for Name: registration; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.registration VALUES (21, 548, NULL, 253, 5); +INSERT INTO swiss.registration VALUES (21, 549, NULL, 254, 5); +INSERT INTO swiss.registration VALUES (21, 550, NULL, 255, 5); +INSERT INTO swiss.registration VALUES (21, 551, NULL, 256, 5); +INSERT INTO swiss.registration VALUES (21, 552, NULL, 257, 5); +INSERT INTO swiss.registration VALUES (21, 553, NULL, 258, 5); +INSERT INTO swiss.registration VALUES (21, 554, NULL, 259, 5); +INSERT INTO swiss.registration VALUES (21, 555, NULL, 260, 5); +INSERT INTO swiss.registration VALUES (21, 556, NULL, 261, 5); +INSERT INTO swiss.registration VALUES (21, 557, NULL, 262, 5); +INSERT INTO swiss.registration VALUES (21, 558, NULL, 263, 5); +INSERT INTO swiss.registration VALUES (21, 559, NULL, 264, 5); +INSERT INTO swiss.registration VALUES (21, 560, NULL, 265, 5); +INSERT INTO swiss.registration VALUES (21, 561, NULL, 266, 5); +INSERT INTO swiss.registration VALUES (21, 562, NULL, 267, 5); +INSERT INTO swiss.registration VALUES (21, 563, NULL, 268, 5); +INSERT INTO swiss.registration VALUES (21, 564, NULL, 269, 5); +INSERT INTO swiss.registration VALUES (21, 565, NULL, 270, 5); +INSERT INTO swiss.registration VALUES (21, 566, NULL, 271, 5); +INSERT INTO swiss.registration VALUES (21, 567, NULL, 272, 5); +INSERT INTO swiss.registration VALUES (21, 568, NULL, 273, 5); +INSERT INTO swiss.registration VALUES (21, 569, NULL, 274, 5); +INSERT INTO swiss.registration VALUES (21, 570, NULL, 275, 5); +INSERT INTO swiss.registration VALUES (21, 571, NULL, 276, 5); +INSERT INTO swiss.registration VALUES (21, 572, NULL, 277, 5); +INSERT INTO swiss.registration VALUES (21, 573, NULL, 278, 5); +INSERT INTO swiss.registration VALUES (21, 574, NULL, 279, 5); +INSERT INTO swiss.registration VALUES (21, 575, NULL, 280, 5); +INSERT INTO swiss.registration VALUES (21, 576, NULL, 281, 5); +INSERT INTO swiss.registration VALUES (21, 577, NULL, 282, 5); +INSERT INTO swiss.registration VALUES (21, 578, NULL, 283, 5); +INSERT INTO swiss.registration VALUES (22, 579, NULL, 284, 5); +INSERT INTO swiss.registration VALUES (22, 580, NULL, 285, 5); +INSERT INTO swiss.registration VALUES (22, 581, NULL, 286, 5); +INSERT INTO swiss.registration VALUES (22, 582, NULL, 287, 5); +INSERT INTO swiss.registration VALUES (22, 583, NULL, 288, 5); +INSERT INTO swiss.registration VALUES (22, 584, NULL, 289, 5); +INSERT INTO swiss.registration VALUES (22, 585, NULL, 290, 5); +INSERT INTO swiss.registration VALUES (22, 586, NULL, 291, 5); +INSERT INTO swiss.registration VALUES (22, 587, NULL, 292, 5); +INSERT INTO swiss.registration VALUES (22, 588, NULL, 293, 5); +INSERT INTO swiss.registration VALUES (22, 589, NULL, 294, 5); +INSERT INTO swiss.registration VALUES (22, 590, NULL, 295, 5); +INSERT INTO swiss.registration VALUES (22, 591, NULL, 296, 5); +INSERT INTO swiss.registration VALUES (22, 592, NULL, 297, 5); +INSERT INTO swiss.registration VALUES (22, 593, NULL, 298, 5); +INSERT INTO swiss.registration VALUES (22, 594, NULL, 299, 5); +INSERT INTO swiss.registration VALUES (22, 595, NULL, 300, 5); +INSERT INTO swiss.registration VALUES (22, 596, NULL, 301, 5); +INSERT INTO swiss.registration VALUES (22, 597, NULL, 302, 5); +INSERT INTO swiss.registration VALUES (22, 598, NULL, 303, 5); +INSERT INTO swiss.registration VALUES (22, 599, NULL, 304, 5); +INSERT INTO swiss.registration VALUES (22, 600, NULL, 305, 5); +INSERT INTO swiss.registration VALUES (22, 601, NULL, 306, 5); +INSERT INTO swiss.registration VALUES (22, 602, NULL, 307, 5); +INSERT INTO swiss.registration VALUES (22, 603, NULL, 308, 5); +INSERT INTO swiss.registration VALUES (22, 604, NULL, 309, 5); +INSERT INTO swiss.registration VALUES (22, 605, NULL, 310, 5); +INSERT INTO swiss.registration VALUES (22, 606, NULL, 311, 5); +INSERT INTO swiss.registration VALUES (22, 607, NULL, 312, 5); +INSERT INTO swiss.registration VALUES (22, 608, NULL, 313, 5); +INSERT INTO swiss.registration VALUES (22, 609, NULL, 314, 5); +INSERT INTO swiss.registration VALUES (22, 610, NULL, 315, 5); +INSERT INTO swiss.registration VALUES (23, 611, 254, 253, 5); +INSERT INTO swiss.registration VALUES (23, 612, 253, 254, 5); +INSERT INTO swiss.registration VALUES (23, 613, 256, 255, 5); +INSERT INTO swiss.registration VALUES (23, 614, 255, 256, 5); +INSERT INTO swiss.registration VALUES (23, 615, 258, 257, 5); +INSERT INTO swiss.registration VALUES (23, 616, 257, 258, 5); +INSERT INTO swiss.registration VALUES (23, 617, 260, 259, 5); +INSERT INTO swiss.registration VALUES (23, 618, 259, 260, 5); +INSERT INTO swiss.registration VALUES (23, 619, 262, 261, 5); +INSERT INTO swiss.registration VALUES (23, 620, 261, 262, 5); +INSERT INTO swiss.registration VALUES (23, 621, 264, 263, 5); +INSERT INTO swiss.registration VALUES (23, 622, 263, 264, 5); +INSERT INTO swiss.registration VALUES (23, 623, 266, 265, 5); +INSERT INTO swiss.registration VALUES (23, 624, 265, 266, 5); +INSERT INTO swiss.registration VALUES (24, 625, 285, 284, 5); +INSERT INTO swiss.registration VALUES (24, 626, 284, 285, 5); +INSERT INTO swiss.registration VALUES (24, 627, 287, 286, 5); +INSERT INTO swiss.registration VALUES (24, 628, 286, 287, 5); +INSERT INTO swiss.registration VALUES (24, 629, 289, 288, 5); +INSERT INTO swiss.registration VALUES (24, 630, 288, 289, 5); +INSERT INTO swiss.registration VALUES (24, 631, 291, 290, 5); +INSERT INTO swiss.registration VALUES (24, 632, 290, 291, 5); +INSERT INTO swiss.registration VALUES (24, 633, 293, 292, 5); +INSERT INTO swiss.registration VALUES (24, 634, 292, 293, 5); +INSERT INTO swiss.registration VALUES (24, 635, 295, 294, 5); +INSERT INTO swiss.registration VALUES (24, 636, 294, 295, 5); +INSERT INTO swiss.registration VALUES (24, 637, 297, 296, 5); +INSERT INTO swiss.registration VALUES (24, 638, 296, 297, 5); +INSERT INTO swiss.registration VALUES (24, 639, 299, 298, 5); +INSERT INTO swiss.registration VALUES (24, 640, 298, 299, 5); +INSERT INTO swiss.registration VALUES (24, 641, 301, 300, 5); +INSERT INTO swiss.registration VALUES (24, 642, 300, 301, 5); +INSERT INTO swiss.registration VALUES (25, 643, 302, 271, 5); +INSERT INTO swiss.registration VALUES (25, 644, 271, 302, 5); +INSERT INTO swiss.registration VALUES (25, 645, 303, 272, 5); +INSERT INTO swiss.registration VALUES (25, 646, 272, 303, 5); +INSERT INTO swiss.registration VALUES (25, 647, 304, 273, 5); +INSERT INTO swiss.registration VALUES (25, 648, 273, 304, 5); +INSERT INTO swiss.registration VALUES (25, 649, 305, 274, 5); +INSERT INTO swiss.registration VALUES (25, 650, 274, 305, 5); +INSERT INTO swiss.registration VALUES (25, 651, 306, 275, 5); +INSERT INTO swiss.registration VALUES (25, 652, 275, 306, 5); +INSERT INTO swiss.registration VALUES (25, 653, 307, 276, 5); +INSERT INTO swiss.registration VALUES (25, 654, 276, 307, 5); +INSERT INTO swiss.registration VALUES (25, 655, 308, 277, 5); +INSERT INTO swiss.registration VALUES (25, 656, 277, 308, 5); +INSERT INTO swiss.registration VALUES (25, 657, 309, 278, 5); +INSERT INTO swiss.registration VALUES (25, 658, 278, 309, 5); +INSERT INTO swiss.registration VALUES (25, 659, 310, 279, 5); +INSERT INTO swiss.registration VALUES (25, 660, 279, 310, 5); +INSERT INTO swiss.registration VALUES (25, 661, 311, 280, 5); +INSERT INTO swiss.registration VALUES (25, 662, 280, 311, 5); +INSERT INTO swiss.registration VALUES (25, 663, 312, 281, 5); +INSERT INTO swiss.registration VALUES (25, 664, 281, 312, 5); +INSERT INTO swiss.registration VALUES (25, 665, 313, 282, 5); +INSERT INTO swiss.registration VALUES (25, 666, 282, 313, 5); +INSERT INTO swiss.registration VALUES (23, 667, 266, 265, 5); +INSERT INTO swiss.registration VALUES (26, 668, NULL, 316, 6); +INSERT INTO swiss.registration VALUES (28, 669, 253, 316, 6); +INSERT INTO swiss.registration VALUES (26, 670, NULL, 253, 6); +INSERT INTO swiss.registration VALUES (28, 671, 316, 253, 6); +INSERT INTO swiss.registration VALUES (30, 673, 284, 254, 6); +INSERT INTO swiss.registration VALUES (32, 786, NULL, 313, 7); +INSERT INTO swiss.registration VALUES (28, 672, 265, 254, 6); +INSERT INTO swiss.registration VALUES (26, 674, NULL, 265, 6); +INSERT INTO swiss.registration VALUES (28, 675, 254, 265, 6); +INSERT INTO swiss.registration VALUES (26, 676, NULL, 261, 6); +INSERT INTO swiss.registration VALUES (28, 677, 262, 259, 6); +INSERT INTO swiss.registration VALUES (30, 678, 287, 259, 6); +INSERT INTO swiss.registration VALUES (28, 679, 259, 262, 6); +INSERT INTO swiss.registration VALUES (27, 680, NULL, 287, 6); +INSERT INTO swiss.registration VALUES (30, 681, 259, 287, 6); +INSERT INTO swiss.registration VALUES (27, 682, NULL, 284, 6); +INSERT INTO swiss.registration VALUES (30, 683, 254, 284, 6); +INSERT INTO swiss.registration VALUES (28, 684, 276, 260, 6); +INSERT INTO swiss.registration VALUES (30, 685, 299, 260, 6); +INSERT INTO swiss.registration VALUES (31, 686, NULL, 316, 7); +INSERT INTO swiss.registration VALUES (32, 687, NULL, 317, 7); +INSERT INTO swiss.registration VALUES (31, 688, NULL, 322, 7); +INSERT INTO swiss.registration VALUES (31, 689, NULL, 331, 7); +INSERT INTO swiss.registration VALUES (31, 690, NULL, 340, 7); +INSERT INTO swiss.registration VALUES (31, 691, NULL, 346, 7); +INSERT INTO swiss.registration VALUES (31, 692, NULL, 347, 7); +INSERT INTO swiss.registration VALUES (31, 693, NULL, 348, 7); +INSERT INTO swiss.registration VALUES (32, 694, NULL, 349, 7); +INSERT INTO swiss.registration VALUES (32, 695, NULL, 350, 7); +INSERT INTO swiss.registration VALUES (32, 696, NULL, 351, 7); +INSERT INTO swiss.registration VALUES (32, 697, NULL, 352, 7); +INSERT INTO swiss.registration VALUES (32, 698, NULL, 353, 7); +INSERT INTO swiss.registration VALUES (32, 699, NULL, 354, 7); +INSERT INTO swiss.registration VALUES (32, 700, NULL, 355, 7); +INSERT INTO swiss.registration VALUES (32, 701, NULL, 356, 7); +INSERT INTO swiss.registration VALUES (32, 702, NULL, 357, 7); +INSERT INTO swiss.registration VALUES (32, 703, NULL, 358, 7); +INSERT INTO swiss.registration VALUES (32, 704, NULL, 359, 7); +INSERT INTO swiss.registration VALUES (32, 705, NULL, 360, 7); +INSERT INTO swiss.registration VALUES (32, 706, NULL, 361, 7); +INSERT INTO swiss.registration VALUES (32, 707, NULL, 362, 7); +INSERT INTO swiss.registration VALUES (32, 708, NULL, 363, 7); +INSERT INTO swiss.registration VALUES (32, 709, NULL, 364, 7); +INSERT INTO swiss.registration VALUES (32, 710, NULL, 365, 7); +INSERT INTO swiss.registration VALUES (32, 711, NULL, 366, 7); +INSERT INTO swiss.registration VALUES (32, 712, NULL, 367, 7); +INSERT INTO swiss.registration VALUES (32, 713, NULL, 368, 7); +INSERT INTO swiss.registration VALUES (32, 714, NULL, 369, 7); +INSERT INTO swiss.registration VALUES (32, 715, NULL, 370, 7); +INSERT INTO swiss.registration VALUES (32, 716, NULL, 371, 7); +INSERT INTO swiss.registration VALUES (32, 717, NULL, 372, 7); +INSERT INTO swiss.registration VALUES (32, 718, NULL, 373, 7); +INSERT INTO swiss.registration VALUES (32, 719, NULL, 374, 7); +INSERT INTO swiss.registration VALUES (32, 720, NULL, 375, 7); +INSERT INTO swiss.registration VALUES (32, 721, NULL, 376, 7); +INSERT INTO swiss.registration VALUES (32, 722, NULL, 377, 7); +INSERT INTO swiss.registration VALUES (32, 723, NULL, 378, 7); +INSERT INTO swiss.registration VALUES (32, 724, NULL, 379, 7); +INSERT INTO swiss.registration VALUES (32, 725, NULL, 380, 7); +INSERT INTO swiss.registration VALUES (31, 726, NULL, 253, 7); +INSERT INTO swiss.registration VALUES (31, 727, NULL, 254, 7); +INSERT INTO swiss.registration VALUES (31, 728, NULL, 255, 7); +INSERT INTO swiss.registration VALUES (31, 729, NULL, 256, 7); +INSERT INTO swiss.registration VALUES (31, 730, NULL, 257, 7); +INSERT INTO swiss.registration VALUES (31, 731, NULL, 258, 7); +INSERT INTO swiss.registration VALUES (31, 732, NULL, 259, 7); +INSERT INTO swiss.registration VALUES (31, 733, NULL, 260, 7); +INSERT INTO swiss.registration VALUES (31, 734, NULL, 261, 7); +INSERT INTO swiss.registration VALUES (31, 735, NULL, 262, 7); +INSERT INTO swiss.registration VALUES (31, 736, NULL, 263, 7); +INSERT INTO swiss.registration VALUES (31, 737, NULL, 264, 7); +INSERT INTO swiss.registration VALUES (31, 738, NULL, 265, 7); +INSERT INTO swiss.registration VALUES (31, 739, NULL, 266, 7); +INSERT INTO swiss.registration VALUES (31, 740, NULL, 267, 7); +INSERT INTO swiss.registration VALUES (31, 741, NULL, 268, 7); +INSERT INTO swiss.registration VALUES (31, 742, NULL, 269, 7); +INSERT INTO swiss.registration VALUES (31, 743, NULL, 270, 7); +INSERT INTO swiss.registration VALUES (31, 744, NULL, 271, 7); +INSERT INTO swiss.registration VALUES (31, 745, NULL, 272, 7); +INSERT INTO swiss.registration VALUES (31, 746, NULL, 273, 7); +INSERT INTO swiss.registration VALUES (31, 747, NULL, 274, 7); +INSERT INTO swiss.registration VALUES (31, 748, NULL, 275, 7); +INSERT INTO swiss.registration VALUES (31, 749, NULL, 276, 7); +INSERT INTO swiss.registration VALUES (31, 750, NULL, 277, 7); +INSERT INTO swiss.registration VALUES (31, 751, NULL, 278, 7); +INSERT INTO swiss.registration VALUES (31, 752, NULL, 279, 7); +INSERT INTO swiss.registration VALUES (31, 753, NULL, 280, 7); +INSERT INTO swiss.registration VALUES (31, 754, NULL, 281, 7); +INSERT INTO swiss.registration VALUES (31, 755, NULL, 282, 7); +INSERT INTO swiss.registration VALUES (31, 756, NULL, 283, 7); +INSERT INTO swiss.registration VALUES (32, 757, NULL, 284, 7); +INSERT INTO swiss.registration VALUES (32, 758, NULL, 285, 7); +INSERT INTO swiss.registration VALUES (32, 759, NULL, 286, 7); +INSERT INTO swiss.registration VALUES (32, 760, NULL, 287, 7); +INSERT INTO swiss.registration VALUES (32, 761, NULL, 288, 7); +INSERT INTO swiss.registration VALUES (32, 762, NULL, 289, 7); +INSERT INTO swiss.registration VALUES (32, 763, NULL, 290, 7); +INSERT INTO swiss.registration VALUES (32, 764, NULL, 291, 7); +INSERT INTO swiss.registration VALUES (32, 765, NULL, 292, 7); +INSERT INTO swiss.registration VALUES (32, 766, NULL, 293, 7); +INSERT INTO swiss.registration VALUES (32, 767, NULL, 294, 7); +INSERT INTO swiss.registration VALUES (32, 768, NULL, 295, 7); +INSERT INTO swiss.registration VALUES (32, 769, NULL, 296, 7); +INSERT INTO swiss.registration VALUES (32, 770, NULL, 297, 7); +INSERT INTO swiss.registration VALUES (32, 771, NULL, 298, 7); +INSERT INTO swiss.registration VALUES (32, 772, NULL, 299, 7); +INSERT INTO swiss.registration VALUES (32, 773, NULL, 300, 7); +INSERT INTO swiss.registration VALUES (32, 774, NULL, 301, 7); +INSERT INTO swiss.registration VALUES (32, 775, NULL, 302, 7); +INSERT INTO swiss.registration VALUES (32, 776, NULL, 303, 7); +INSERT INTO swiss.registration VALUES (32, 777, NULL, 304, 7); +INSERT INTO swiss.registration VALUES (32, 778, NULL, 305, 7); +INSERT INTO swiss.registration VALUES (32, 779, NULL, 306, 7); +INSERT INTO swiss.registration VALUES (32, 780, NULL, 307, 7); +INSERT INTO swiss.registration VALUES (32, 781, NULL, 308, 7); +INSERT INTO swiss.registration VALUES (32, 782, NULL, 309, 7); +INSERT INTO swiss.registration VALUES (32, 783, NULL, 310, 7); +INSERT INTO swiss.registration VALUES (32, 784, NULL, 311, 7); +INSERT INTO swiss.registration VALUES (32, 785, NULL, 312, 7); +INSERT INTO swiss.registration VALUES (32, 787, NULL, 314, 7); +INSERT INTO swiss.registration VALUES (32, 788, NULL, 315, 7); +INSERT INTO swiss.registration VALUES (31, 789, NULL, 318, 7); +INSERT INTO swiss.registration VALUES (31, 790, NULL, 319, 7); +INSERT INTO swiss.registration VALUES (31, 791, NULL, 320, 7); +INSERT INTO swiss.registration VALUES (31, 792, NULL, 321, 7); +INSERT INTO swiss.registration VALUES (31, 793, NULL, 323, 7); +INSERT INTO swiss.registration VALUES (31, 794, NULL, 324, 7); +INSERT INTO swiss.registration VALUES (31, 795, NULL, 325, 7); +INSERT INTO swiss.registration VALUES (31, 796, NULL, 326, 7); +INSERT INTO swiss.registration VALUES (31, 797, NULL, 327, 7); +INSERT INTO swiss.registration VALUES (31, 798, NULL, 328, 7); +INSERT INTO swiss.registration VALUES (31, 799, NULL, 329, 7); +INSERT INTO swiss.registration VALUES (31, 800, NULL, 330, 7); +INSERT INTO swiss.registration VALUES (31, 801, NULL, 332, 7); +INSERT INTO swiss.registration VALUES (31, 802, NULL, 333, 7); +INSERT INTO swiss.registration VALUES (31, 803, NULL, 334, 7); +INSERT INTO swiss.registration VALUES (31, 804, NULL, 335, 7); +INSERT INTO swiss.registration VALUES (31, 805, NULL, 336, 7); +INSERT INTO swiss.registration VALUES (31, 806, NULL, 337, 7); +INSERT INTO swiss.registration VALUES (31, 807, NULL, 338, 7); +INSERT INTO swiss.registration VALUES (31, 808, NULL, 339, 7); +INSERT INTO swiss.registration VALUES (31, 809, NULL, 341, 7); +INSERT INTO swiss.registration VALUES (31, 810, NULL, 342, 7); +INSERT INTO swiss.registration VALUES (33, 814, 322, 316, 7); +INSERT INTO swiss.registration VALUES (33, 815, 316, 322, 7); +INSERT INTO swiss.registration VALUES (33, 816, 340, 331, 7); +INSERT INTO swiss.registration VALUES (33, 817, 331, 340, 7); +INSERT INTO swiss.registration VALUES (33, 818, 347, 346, 7); +INSERT INTO swiss.registration VALUES (33, 819, 346, 347, 7); +INSERT INTO swiss.registration VALUES (33, 820, 253, 348, 7); +INSERT INTO swiss.registration VALUES (33, 821, 348, 253, 7); +INSERT INTO swiss.registration VALUES (33, 822, 255, 254, 7); +INSERT INTO swiss.registration VALUES (33, 824, 257, 256, 7); +INSERT INTO swiss.registration VALUES (33, 825, 256, 257, 7); +INSERT INTO swiss.registration VALUES (33, 826, 259, 258, 7); +INSERT INTO swiss.registration VALUES (33, 827, 258, 259, 7); +INSERT INTO swiss.registration VALUES (34, 828, 349, 317, 7); +INSERT INTO swiss.registration VALUES (34, 829, 317, 349, 7); +INSERT INTO swiss.registration VALUES (34, 830, 351, 350, 7); +INSERT INTO swiss.registration VALUES (34, 831, 350, 351, 7); +INSERT INTO swiss.registration VALUES (34, 832, 353, 352, 7); +INSERT INTO swiss.registration VALUES (34, 833, 352, 353, 7); +INSERT INTO swiss.registration VALUES (34, 834, 355, 354, 7); +INSERT INTO swiss.registration VALUES (34, 835, 354, 355, 7); +INSERT INTO swiss.registration VALUES (34, 837, 356, 357, 7); +INSERT INTO swiss.registration VALUES (34, 838, 359, 358, 7); +INSERT INTO swiss.registration VALUES (34, 839, 358, 359, 7); +INSERT INTO swiss.registration VALUES (34, 840, 361, 360, 7); +INSERT INTO swiss.registration VALUES (34, 841, 360, 361, 7); +INSERT INTO swiss.registration VALUES (34, 842, 363, 362, 7); +INSERT INTO swiss.registration VALUES (34, 843, 362, 363, 7); +INSERT INTO swiss.registration VALUES (34, 844, 365, 364, 7); +INSERT INTO swiss.registration VALUES (34, 845, 364, 365, 7); +INSERT INTO swiss.registration VALUES (35, 846, 366, 264, 7); +INSERT INTO swiss.registration VALUES (35, 847, 264, 366, 7); +INSERT INTO swiss.registration VALUES (35, 849, 265, 367, 7); +INSERT INTO swiss.registration VALUES (35, 850, 368, 266, 7); +INSERT INTO swiss.registration VALUES (35, 851, 266, 368, 7); +INSERT INTO swiss.registration VALUES (35, 852, 369, 267, 7); +INSERT INTO swiss.registration VALUES (35, 853, 267, 369, 7); +INSERT INTO swiss.registration VALUES (35, 854, 370, 268, 7); +INSERT INTO swiss.registration VALUES (35, 855, 268, 370, 7); +INSERT INTO swiss.registration VALUES (35, 856, 371, 269, 7); +INSERT INTO swiss.registration VALUES (35, 857, 269, 371, 7); +INSERT INTO swiss.registration VALUES (35, 858, 372, 270, 7); +INSERT INTO swiss.registration VALUES (35, 859, 270, 372, 7); +INSERT INTO swiss.registration VALUES (35, 860, 373, 271, 7); +INSERT INTO swiss.registration VALUES (35, 861, 271, 373, 7); +INSERT INTO swiss.registration VALUES (35, 862, 374, 272, 7); +INSERT INTO swiss.registration VALUES (35, 863, 272, 374, 7); +INSERT INTO swiss.registration VALUES (35, 865, 273, 375, 7); +INSERT INTO swiss.registration VALUES (35, 866, 376, 274, 7); +INSERT INTO swiss.registration VALUES (35, 867, 274, 376, 7); +INSERT INTO swiss.registration VALUES (35, 868, 377, 275, 7); +INSERT INTO swiss.registration VALUES (35, 869, 275, 377, 7); +INSERT INTO swiss.registration VALUES (31, 811, NULL, 343, 7); +INSERT INTO swiss.registration VALUES (31, 812, NULL, 344, 7); +INSERT INTO swiss.registration VALUES (31, 813, NULL, 345, 7); +INSERT INTO swiss.registration VALUES (33, 823, 254, 255, 7); +INSERT INTO swiss.registration VALUES (34, 836, 357, 356, 7); +INSERT INTO swiss.registration VALUES (35, 848, 367, 265, 7); +INSERT INTO swiss.registration VALUES (35, 864, 375, 273, 7); +INSERT INTO swiss.registration VALUES (28, 870, 263, 276, 6); +INSERT INTO swiss.registration VALUES (30, 871, NULL, 276, 6); +INSERT INTO swiss.registration VALUES (36, 872, NULL, 316, 8); +INSERT INTO swiss.registration VALUES (37, 873, NULL, 317, 8); +INSERT INTO swiss.registration VALUES (36, 874, NULL, 322, 8); +INSERT INTO swiss.registration VALUES (36, 875, NULL, 331, 8); +INSERT INTO swiss.registration VALUES (36, 876, NULL, 340, 8); +INSERT INTO swiss.registration VALUES (36, 877, NULL, 346, 8); +INSERT INTO swiss.registration VALUES (36, 878, NULL, 347, 8); +INSERT INTO swiss.registration VALUES (36, 879, NULL, 348, 8); +INSERT INTO swiss.registration VALUES (37, 880, NULL, 349, 8); +INSERT INTO swiss.registration VALUES (37, 881, NULL, 350, 8); +INSERT INTO swiss.registration VALUES (37, 882, NULL, 351, 8); +INSERT INTO swiss.registration VALUES (37, 883, NULL, 352, 8); +INSERT INTO swiss.registration VALUES (37, 884, NULL, 353, 8); +INSERT INTO swiss.registration VALUES (37, 885, NULL, 354, 8); +INSERT INTO swiss.registration VALUES (37, 886, NULL, 355, 8); +INSERT INTO swiss.registration VALUES (37, 887, NULL, 356, 8); +INSERT INTO swiss.registration VALUES (37, 888, NULL, 357, 8); +INSERT INTO swiss.registration VALUES (37, 889, NULL, 358, 8); +INSERT INTO swiss.registration VALUES (37, 890, NULL, 359, 8); +INSERT INTO swiss.registration VALUES (37, 891, NULL, 360, 8); +INSERT INTO swiss.registration VALUES (37, 892, NULL, 361, 8); +INSERT INTO swiss.registration VALUES (37, 893, NULL, 362, 8); +INSERT INTO swiss.registration VALUES (37, 894, NULL, 363, 8); +INSERT INTO swiss.registration VALUES (37, 895, NULL, 364, 8); +INSERT INTO swiss.registration VALUES (37, 896, NULL, 365, 8); +INSERT INTO swiss.registration VALUES (37, 897, NULL, 366, 8); +INSERT INTO swiss.registration VALUES (37, 898, NULL, 367, 8); +INSERT INTO swiss.registration VALUES (37, 899, NULL, 368, 8); +INSERT INTO swiss.registration VALUES (37, 900, NULL, 369, 8); +INSERT INTO swiss.registration VALUES (37, 901, NULL, 370, 8); +INSERT INTO swiss.registration VALUES (37, 902, NULL, 371, 8); +INSERT INTO swiss.registration VALUES (37, 903, NULL, 372, 8); +INSERT INTO swiss.registration VALUES (37, 904, NULL, 373, 8); +INSERT INTO swiss.registration VALUES (37, 905, NULL, 374, 8); +INSERT INTO swiss.registration VALUES (37, 906, NULL, 375, 8); +INSERT INTO swiss.registration VALUES (37, 907, NULL, 376, 8); +INSERT INTO swiss.registration VALUES (37, 908, NULL, 377, 8); +INSERT INTO swiss.registration VALUES (37, 909, NULL, 378, 8); +INSERT INTO swiss.registration VALUES (37, 910, NULL, 379, 8); +INSERT INTO swiss.registration VALUES (37, 911, NULL, 380, 8); +INSERT INTO swiss.registration VALUES (36, 912, NULL, 381, 8); +INSERT INTO swiss.registration VALUES (36, 913, NULL, 382, 8); +INSERT INTO swiss.registration VALUES (36, 914, NULL, 383, 8); +INSERT INTO swiss.registration VALUES (36, 915, NULL, 384, 8); +INSERT INTO swiss.registration VALUES (36, 916, NULL, 385, 8); +INSERT INTO swiss.registration VALUES (36, 917, NULL, 386, 8); +INSERT INTO swiss.registration VALUES (36, 918, NULL, 387, 8); +INSERT INTO swiss.registration VALUES (36, 919, NULL, 388, 8); +INSERT INTO swiss.registration VALUES (36, 920, NULL, 389, 8); +INSERT INTO swiss.registration VALUES (36, 921, NULL, 390, 8); +INSERT INTO swiss.registration VALUES (36, 922, NULL, 391, 8); +INSERT INTO swiss.registration VALUES (36, 923, NULL, 392, 8); +INSERT INTO swiss.registration VALUES (36, 924, NULL, 393, 8); +INSERT INTO swiss.registration VALUES (36, 925, NULL, 394, 8); +INSERT INTO swiss.registration VALUES (36, 926, NULL, 395, 8); +INSERT INTO swiss.registration VALUES (36, 927, NULL, 396, 8); +INSERT INTO swiss.registration VALUES (36, 928, NULL, 397, 8); +INSERT INTO swiss.registration VALUES (36, 929, NULL, 398, 8); +INSERT INTO swiss.registration VALUES (36, 930, NULL, 399, 8); +INSERT INTO swiss.registration VALUES (36, 931, NULL, 400, 8); +INSERT INTO swiss.registration VALUES (36, 932, NULL, 401, 8); +INSERT INTO swiss.registration VALUES (36, 933, NULL, 402, 8); +INSERT INTO swiss.registration VALUES (36, 934, NULL, 403, 8); +INSERT INTO swiss.registration VALUES (36, 935, NULL, 253, 8); +INSERT INTO swiss.registration VALUES (36, 936, NULL, 254, 8); +INSERT INTO swiss.registration VALUES (36, 937, NULL, 255, 8); +INSERT INTO swiss.registration VALUES (36, 938, NULL, 256, 8); +INSERT INTO swiss.registration VALUES (36, 939, NULL, 257, 8); +INSERT INTO swiss.registration VALUES (36, 940, NULL, 258, 8); +INSERT INTO swiss.registration VALUES (36, 941, NULL, 259, 8); +INSERT INTO swiss.registration VALUES (36, 942, NULL, 260, 8); +INSERT INTO swiss.registration VALUES (36, 943, NULL, 261, 8); +INSERT INTO swiss.registration VALUES (36, 944, NULL, 262, 8); +INSERT INTO swiss.registration VALUES (36, 945, NULL, 263, 8); +INSERT INTO swiss.registration VALUES (36, 946, NULL, 264, 8); +INSERT INTO swiss.registration VALUES (36, 947, NULL, 404, 8); +INSERT INTO swiss.registration VALUES (36, 948, NULL, 265, 8); +INSERT INTO swiss.registration VALUES (36, 949, NULL, 266, 8); +INSERT INTO swiss.registration VALUES (36, 950, NULL, 267, 8); +INSERT INTO swiss.registration VALUES (36, 951, NULL, 268, 8); +INSERT INTO swiss.registration VALUES (36, 952, NULL, 269, 8); +INSERT INTO swiss.registration VALUES (36, 953, NULL, 270, 8); +INSERT INTO swiss.registration VALUES (36, 954, NULL, 271, 8); +INSERT INTO swiss.registration VALUES (36, 955, NULL, 272, 8); +INSERT INTO swiss.registration VALUES (36, 956, NULL, 273, 8); +INSERT INTO swiss.registration VALUES (36, 957, NULL, 274, 8); +INSERT INTO swiss.registration VALUES (36, 958, NULL, 275, 8); +INSERT INTO swiss.registration VALUES (36, 959, NULL, 276, 8); +INSERT INTO swiss.registration VALUES (36, 960, NULL, 277, 8); +INSERT INTO swiss.registration VALUES (36, 961, NULL, 278, 8); +INSERT INTO swiss.registration VALUES (36, 962, NULL, 279, 8); +INSERT INTO swiss.registration VALUES (36, 963, NULL, 280, 8); +INSERT INTO swiss.registration VALUES (36, 964, NULL, 281, 8); +INSERT INTO swiss.registration VALUES (36, 965, NULL, 282, 8); +INSERT INTO swiss.registration VALUES (36, 966, NULL, 283, 8); +INSERT INTO swiss.registration VALUES (37, 967, NULL, 284, 8); +INSERT INTO swiss.registration VALUES (37, 968, NULL, 285, 8); +INSERT INTO swiss.registration VALUES (37, 969, NULL, 286, 8); +INSERT INTO swiss.registration VALUES (37, 970, NULL, 287, 8); +INSERT INTO swiss.registration VALUES (37, 971, NULL, 288, 8); +INSERT INTO swiss.registration VALUES (37, 972, NULL, 289, 8); +INSERT INTO swiss.registration VALUES (37, 973, NULL, 290, 8); +INSERT INTO swiss.registration VALUES (37, 974, NULL, 291, 8); +INSERT INTO swiss.registration VALUES (37, 975, NULL, 292, 8); +INSERT INTO swiss.registration VALUES (37, 976, NULL, 293, 8); +INSERT INTO swiss.registration VALUES (37, 977, NULL, 294, 8); +INSERT INTO swiss.registration VALUES (37, 978, NULL, 295, 8); +INSERT INTO swiss.registration VALUES (37, 979, NULL, 296, 8); +INSERT INTO swiss.registration VALUES (37, 980, NULL, 297, 8); +INSERT INTO swiss.registration VALUES (37, 981, NULL, 298, 8); +INSERT INTO swiss.registration VALUES (37, 982, NULL, 299, 8); +INSERT INTO swiss.registration VALUES (37, 983, NULL, 300, 8); +INSERT INTO swiss.registration VALUES (37, 984, NULL, 301, 8); +INSERT INTO swiss.registration VALUES (37, 985, NULL, 302, 8); +INSERT INTO swiss.registration VALUES (37, 986, NULL, 303, 8); +INSERT INTO swiss.registration VALUES (37, 987, NULL, 304, 8); +INSERT INTO swiss.registration VALUES (37, 988, NULL, 305, 8); +INSERT INTO swiss.registration VALUES (37, 989, NULL, 306, 8); +INSERT INTO swiss.registration VALUES (37, 990, NULL, 307, 8); +INSERT INTO swiss.registration VALUES (37, 991, NULL, 308, 8); +INSERT INTO swiss.registration VALUES (37, 992, NULL, 309, 8); +INSERT INTO swiss.registration VALUES (37, 993, NULL, 310, 8); +INSERT INTO swiss.registration VALUES (37, 994, NULL, 311, 8); +INSERT INTO swiss.registration VALUES (37, 995, NULL, 312, 8); +INSERT INTO swiss.registration VALUES (37, 996, NULL, 313, 8); +INSERT INTO swiss.registration VALUES (37, 997, NULL, 314, 8); +INSERT INTO swiss.registration VALUES (37, 998, NULL, 315, 8); +INSERT INTO swiss.registration VALUES (36, 999, NULL, 318, 8); +INSERT INTO swiss.registration VALUES (36, 1002, NULL, 321, 8); +INSERT INTO swiss.registration VALUES (36, 1004, NULL, 324, 8); +INSERT INTO swiss.registration VALUES (36, 1005, NULL, 325, 8); +INSERT INTO swiss.registration VALUES (36, 1006, NULL, 326, 8); +INSERT INTO swiss.registration VALUES (36, 1007, NULL, 327, 8); +INSERT INTO swiss.registration VALUES (36, 1008, NULL, 328, 8); +INSERT INTO swiss.registration VALUES (36, 1011, NULL, 332, 8); +INSERT INTO swiss.registration VALUES (36, 1013, NULL, 334, 8); +INSERT INTO swiss.registration VALUES (36, 1014, NULL, 335, 8); +INSERT INTO swiss.registration VALUES (36, 1015, NULL, 336, 8); +INSERT INTO swiss.registration VALUES (36, 1016, NULL, 337, 8); +INSERT INTO swiss.registration VALUES (36, 1017, NULL, 338, 8); +INSERT INTO swiss.registration VALUES (36, 1018, NULL, 339, 8); +INSERT INTO swiss.registration VALUES (36, 1021, NULL, 343, 8); +INSERT INTO swiss.registration VALUES (36, 1023, NULL, 345, 8); +INSERT INTO swiss.registration VALUES (36, 1024, NULL, 405, 8); +INSERT INTO swiss.registration VALUES (36, 1025, NULL, 407, 8); +INSERT INTO swiss.registration VALUES (36, 1026, NULL, 408, 8); +INSERT INTO swiss.registration VALUES (36, 1027, NULL, 411, 8); +INSERT INTO swiss.registration VALUES (37, 1030, NULL, 417, 8); +INSERT INTO swiss.registration VALUES (37, 1032, NULL, 419, 8); +INSERT INTO swiss.registration VALUES (37, 1033, NULL, 422, 8); +INSERT INTO swiss.registration VALUES (37, 1034, NULL, 425, 8); +INSERT INTO swiss.registration VALUES (37, 1035, NULL, 427, 8); +INSERT INTO swiss.registration VALUES (37, 1036, NULL, 428, 8); +INSERT INTO swiss.registration VALUES (37, 1040, NULL, 437, 8); +INSERT INTO swiss.registration VALUES (36, 1043, NULL, 406, 8); +INSERT INTO swiss.registration VALUES (36, 1044, NULL, 409, 8); +INSERT INTO swiss.registration VALUES (36, 1045, NULL, 410, 8); +INSERT INTO swiss.registration VALUES (37, 1046, NULL, 415, 8); +INSERT INTO swiss.registration VALUES (37, 1047, NULL, 420, 8); +INSERT INTO swiss.registration VALUES (37, 1050, NULL, 429, 8); +INSERT INTO swiss.registration VALUES (37, 1052, NULL, 435, 8); +INSERT INTO swiss.registration VALUES (37, 1053, NULL, 438, 8); +INSERT INTO swiss.registration VALUES (37, 1054, NULL, 439, 8); +INSERT INTO swiss.registration VALUES (37, 1055, NULL, 412, 8); +INSERT INTO swiss.registration VALUES (37, 1056, NULL, 413, 8); +INSERT INTO swiss.registration VALUES (37, 1059, NULL, 432, 8); +INSERT INTO swiss.registration VALUES (37, 1061, NULL, 441, 8); +INSERT INTO swiss.registration VALUES (37, 1062, NULL, 442, 8); +INSERT INTO swiss.registration VALUES (38, 1063, 322, 316, 8); +INSERT INTO swiss.registration VALUES (38, 1064, 316, 322, 8); +INSERT INTO swiss.registration VALUES (38, 1067, 347, 346, 8); +INSERT INTO swiss.registration VALUES (38, 1068, 346, 347, 8); +INSERT INTO swiss.registration VALUES (38, 1072, 382, 383, 8); +INSERT INTO swiss.registration VALUES (38, 1073, 385, 384, 8); +INSERT INTO swiss.registration VALUES (38, 1074, 384, 385, 8); +INSERT INTO swiss.registration VALUES (38, 1075, 387, 386, 8); +INSERT INTO swiss.registration VALUES (38, 1076, 386, 387, 8); +INSERT INTO swiss.registration VALUES (36, 1000, NULL, 319, 8); +INSERT INTO swiss.registration VALUES (36, 1009, NULL, 329, 8); +INSERT INTO swiss.registration VALUES (36, 1019, NULL, 341, 8); +INSERT INTO swiss.registration VALUES (37, 1028, NULL, 414, 8); +INSERT INTO swiss.registration VALUES (37, 1037, NULL, 431, 8); +INSERT INTO swiss.registration VALUES (37, 1048, NULL, 421, 8); +INSERT INTO swiss.registration VALUES (37, 1057, NULL, 423, 8); +INSERT INTO swiss.registration VALUES (38, 1065, 340, 331, 8); +INSERT INTO swiss.registration VALUES (39, 1077, 349, 317, 8); +INSERT INTO swiss.registration VALUES (36, 1001, NULL, 320, 8); +INSERT INTO swiss.registration VALUES (36, 1003, NULL, 323, 8); +INSERT INTO swiss.registration VALUES (36, 1010, NULL, 330, 8); +INSERT INTO swiss.registration VALUES (36, 1012, NULL, 333, 8); +INSERT INTO swiss.registration VALUES (36, 1020, NULL, 342, 8); +INSERT INTO swiss.registration VALUES (36, 1022, NULL, 344, 8); +INSERT INTO swiss.registration VALUES (37, 1029, NULL, 416, 8); +INSERT INTO swiss.registration VALUES (37, 1031, NULL, 418, 8); +INSERT INTO swiss.registration VALUES (37, 1038, NULL, 434, 8); +INSERT INTO swiss.registration VALUES (37, 1039, NULL, 436, 8); +INSERT INTO swiss.registration VALUES (37, 1041, NULL, 440, 8); +INSERT INTO swiss.registration VALUES (37, 1042, NULL, 443, 8); +INSERT INTO swiss.registration VALUES (37, 1049, NULL, 426, 8); +INSERT INTO swiss.registration VALUES (37, 1051, NULL, 430, 8); +INSERT INTO swiss.registration VALUES (37, 1058, NULL, 424, 8); +INSERT INTO swiss.registration VALUES (37, 1060, NULL, 433, 8); +INSERT INTO swiss.registration VALUES (38, 1066, 331, 340, 8); +INSERT INTO swiss.registration VALUES (38, 1069, 381, 348, 8); +INSERT INTO swiss.registration VALUES (38, 1070, 348, 381, 8); +INSERT INTO swiss.registration VALUES (38, 1071, 383, 382, 8); +INSERT INTO swiss.registration VALUES (39, 1078, 317, 349, 8); +INSERT INTO swiss.registration VALUES (39, 1079, 351, 350, 8); +INSERT INTO swiss.registration VALUES (39, 1080, 350, 351, 8); +INSERT INTO swiss.registration VALUES (39, 1081, 353, 352, 8); +INSERT INTO swiss.registration VALUES (39, 1082, 352, 353, 8); +INSERT INTO swiss.registration VALUES (39, 1083, 355, 354, 8); +INSERT INTO swiss.registration VALUES (39, 1084, 354, 355, 8); +INSERT INTO swiss.registration VALUES (39, 1085, 357, 356, 8); +INSERT INTO swiss.registration VALUES (39, 1086, 356, 357, 8); +INSERT INTO swiss.registration VALUES (39, 1087, 359, 358, 8); +INSERT INTO swiss.registration VALUES (39, 1088, 358, 359, 8); +INSERT INTO swiss.registration VALUES (39, 1089, 361, 360, 8); +INSERT INTO swiss.registration VALUES (39, 1090, 360, 361, 8); +INSERT INTO swiss.registration VALUES (39, 1091, 363, 362, 8); +INSERT INTO swiss.registration VALUES (39, 1092, 362, 363, 8); +INSERT INTO swiss.registration VALUES (39, 1093, 365, 364, 8); +INSERT INTO swiss.registration VALUES (39, 1094, 364, 365, 8); +INSERT INTO swiss.registration VALUES (40, 1095, 366, 392, 8); +INSERT INTO swiss.registration VALUES (40, 1096, 392, 366, 8); +INSERT INTO swiss.registration VALUES (40, 1097, 367, 393, 8); +INSERT INTO swiss.registration VALUES (40, 1098, 393, 367, 8); +INSERT INTO swiss.registration VALUES (40, 1099, 368, 394, 8); +INSERT INTO swiss.registration VALUES (40, 1100, 394, 368, 8); +INSERT INTO swiss.registration VALUES (40, 1101, 369, 395, 8); +INSERT INTO swiss.registration VALUES (40, 1102, 395, 369, 8); +INSERT INTO swiss.registration VALUES (40, 1103, 370, 396, 8); +INSERT INTO swiss.registration VALUES (40, 1104, 396, 370, 8); +INSERT INTO swiss.registration VALUES (40, 1105, 371, 397, 8); +INSERT INTO swiss.registration VALUES (40, 1106, 397, 371, 8); +INSERT INTO swiss.registration VALUES (40, 1107, 372, 398, 8); +INSERT INTO swiss.registration VALUES (40, 1108, 398, 372, 8); +INSERT INTO swiss.registration VALUES (40, 1109, 373, 399, 8); +INSERT INTO swiss.registration VALUES (40, 1110, 399, 373, 8); +INSERT INTO swiss.registration VALUES (40, 1111, 374, 400, 8); +INSERT INTO swiss.registration VALUES (40, 1112, 400, 374, 8); +INSERT INTO swiss.registration VALUES (40, 1113, 375, 401, 8); +INSERT INTO swiss.registration VALUES (40, 1114, 401, 375, 8); +INSERT INTO swiss.registration VALUES (40, 1115, 376, 402, 8); +INSERT INTO swiss.registration VALUES (40, 1116, 402, 376, 8); +INSERT INTO swiss.registration VALUES (40, 1117, 377, 403, 8); +INSERT INTO swiss.registration VALUES (40, 1118, 403, 377, 8); + + +-- +-- TOC entry 3617 (class 0 OID 17364) +-- Dependencies: 270 +-- Data for Name: round; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.round VALUES (0, NULL, 10, 3, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 11, 4, 'Ronde 1'); +INSERT INTO swiss.round VALUES (2, NULL, 8, 1, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 22, 8, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, 359, 23, 9, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 24, 10, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 25, 11, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, 404, 26, 12, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, 411, 27, 13, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 28, 14, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, 353, 23, 16, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 24, 17, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 25, 18, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, 404, 26, 19, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, 407, 27, 20, 'Ronde 1'); +INSERT INTO swiss.round VALUES (0, NULL, 28, 21, 'Ronde 1'); +INSERT INTO swiss.round VALUES (2, NULL, 22, 15, 'Ronde 1'); + + +-- +-- TOC entry 3624 (class 0 OID 17444) +-- Dependencies: 277 +-- Data for Name: round_matches; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.round_matches VALUES (45, 8); +INSERT INTO swiss.round_matches VALUES (46, 8); +INSERT INTO swiss.round_matches VALUES (47, 8); +INSERT INTO swiss.round_matches VALUES (48, 8); +INSERT INTO swiss.round_matches VALUES (49, 8); +INSERT INTO swiss.round_matches VALUES (50, 8); +INSERT INTO swiss.round_matches VALUES (51, 8); +INSERT INTO swiss.round_matches VALUES (52, 8); +INSERT INTO swiss.round_matches VALUES (53, 9); +INSERT INTO swiss.round_matches VALUES (54, 9); +INSERT INTO swiss.round_matches VALUES (55, 9); +INSERT INTO swiss.round_matches VALUES (56, 9); +INSERT INTO swiss.round_matches VALUES (57, 9); +INSERT INTO swiss.round_matches VALUES (58, 9); +INSERT INTO swiss.round_matches VALUES (59, 9); +INSERT INTO swiss.round_matches VALUES (60, 10); +INSERT INTO swiss.round_matches VALUES (61, 10); +INSERT INTO swiss.round_matches VALUES (62, 10); +INSERT INTO swiss.round_matches VALUES (63, 10); +INSERT INTO swiss.round_matches VALUES (64, 10); +INSERT INTO swiss.round_matches VALUES (65, 10); +INSERT INTO swiss.round_matches VALUES (66, 10); +INSERT INTO swiss.round_matches VALUES (67, 10); +INSERT INTO swiss.round_matches VALUES (68, 11); +INSERT INTO swiss.round_matches VALUES (69, 11); +INSERT INTO swiss.round_matches VALUES (70, 11); +INSERT INTO swiss.round_matches VALUES (71, 11); +INSERT INTO swiss.round_matches VALUES (72, 11); +INSERT INTO swiss.round_matches VALUES (73, 11); +INSERT INTO swiss.round_matches VALUES (74, 11); +INSERT INTO swiss.round_matches VALUES (75, 11); +INSERT INTO swiss.round_matches VALUES (76, 12); +INSERT INTO swiss.round_matches VALUES (77, 12); +INSERT INTO swiss.round_matches VALUES (78, 12); +INSERT INTO swiss.round_matches VALUES (79, 13); +INSERT INTO swiss.round_matches VALUES (80, 13); +INSERT INTO swiss.round_matches VALUES (81, 13); +INSERT INTO swiss.round_matches VALUES (82, 13); +INSERT INTO swiss.round_matches VALUES (83, 14); +INSERT INTO swiss.round_matches VALUES (84, 14); +INSERT INTO swiss.round_matches VALUES (85, 14); +INSERT INTO swiss.round_matches VALUES (86, 14); +INSERT INTO swiss.round_matches VALUES (87, 14); +INSERT INTO swiss.round_matches VALUES (88, 14); +INSERT INTO swiss.round_matches VALUES (89, 15); +INSERT INTO swiss.round_matches VALUES (90, 15); +INSERT INTO swiss.round_matches VALUES (91, 15); +INSERT INTO swiss.round_matches VALUES (92, 15); +INSERT INTO swiss.round_matches VALUES (93, 15); +INSERT INTO swiss.round_matches VALUES (94, 15); +INSERT INTO swiss.round_matches VALUES (95, 15); +INSERT INTO swiss.round_matches VALUES (96, 15); +INSERT INTO swiss.round_matches VALUES (97, 16); +INSERT INTO swiss.round_matches VALUES (98, 16); +INSERT INTO swiss.round_matches VALUES (99, 16); +INSERT INTO swiss.round_matches VALUES (100, 16); +INSERT INTO swiss.round_matches VALUES (101, 16); +INSERT INTO swiss.round_matches VALUES (102, 16); +INSERT INTO swiss.round_matches VALUES (103, 16); +INSERT INTO swiss.round_matches VALUES (104, 17); +INSERT INTO swiss.round_matches VALUES (105, 17); +INSERT INTO swiss.round_matches VALUES (106, 17); +INSERT INTO swiss.round_matches VALUES (107, 17); +INSERT INTO swiss.round_matches VALUES (108, 17); +INSERT INTO swiss.round_matches VALUES (109, 17); +INSERT INTO swiss.round_matches VALUES (110, 17); +INSERT INTO swiss.round_matches VALUES (111, 17); +INSERT INTO swiss.round_matches VALUES (112, 18); +INSERT INTO swiss.round_matches VALUES (113, 18); +INSERT INTO swiss.round_matches VALUES (114, 18); +INSERT INTO swiss.round_matches VALUES (115, 18); +INSERT INTO swiss.round_matches VALUES (116, 18); +INSERT INTO swiss.round_matches VALUES (117, 18); +INSERT INTO swiss.round_matches VALUES (118, 18); +INSERT INTO swiss.round_matches VALUES (119, 18); +INSERT INTO swiss.round_matches VALUES (120, 19); +INSERT INTO swiss.round_matches VALUES (121, 19); +INSERT INTO swiss.round_matches VALUES (122, 19); +INSERT INTO swiss.round_matches VALUES (123, 20); +INSERT INTO swiss.round_matches VALUES (124, 20); +INSERT INTO swiss.round_matches VALUES (125, 20); +INSERT INTO swiss.round_matches VALUES (126, 20); +INSERT INTO swiss.round_matches VALUES (127, 21); +INSERT INTO swiss.round_matches VALUES (128, 21); +INSERT INTO swiss.round_matches VALUES (129, 21); +INSERT INTO swiss.round_matches VALUES (130, 21); +INSERT INTO swiss.round_matches VALUES (131, 21); +INSERT INTO swiss.round_matches VALUES (132, 21); + + +-- +-- TOC entry 3625 (class 0 OID 17459) +-- Dependencies: 278 +-- Data for Name: round_quit; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + + + +-- +-- TOC entry 3614 (class 0 OID 17328) +-- Dependencies: 267 +-- Data for Name: team; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.team VALUES (15, 246, 277, NULL); +INSERT INTO swiss.team VALUES (15, 247, 283, NULL); +INSERT INTO swiss.team VALUES (15, 248, 276, NULL); +INSERT INTO swiss.team VALUES (15, 249, 261, NULL); +INSERT INTO swiss.team VALUES (15, 250, 273, NULL); +INSERT INTO swiss.team VALUES (15, 251, 266, NULL); +INSERT INTO swiss.team VALUES (15, 252, 255, NULL); +INSERT INTO swiss.team VALUES (15, 253, 280, NULL); +INSERT INTO swiss.team VALUES (15, 254, 257, NULL); +INSERT INTO swiss.team VALUES (15, 255, 272, NULL); +INSERT INTO swiss.team VALUES (15, 256, 263, NULL); +INSERT INTO swiss.team VALUES (15, 257, 258, NULL); +INSERT INTO swiss.team VALUES (15, 258, 281, NULL); +INSERT INTO swiss.team VALUES (15, 259, 268, NULL); +INSERT INTO swiss.team VALUES (15, 260, 275, NULL); +INSERT INTO swiss.team VALUES (15, 261, 265, NULL); +INSERT INTO swiss.team VALUES (16, 262, 271, NULL); +INSERT INTO swiss.team VALUES (16, 263, 259, NULL); +INSERT INTO swiss.team VALUES (16, 264, 274, NULL); +INSERT INTO swiss.team VALUES (16, 265, 253, NULL); +INSERT INTO swiss.team VALUES (16, 266, 270, NULL); +INSERT INTO swiss.team VALUES (16, 267, 278, NULL); +INSERT INTO swiss.team VALUES (16, 268, 256, NULL); +INSERT INTO swiss.team VALUES (16, 269, 269, NULL); +INSERT INTO swiss.team VALUES (16, 270, 262, NULL); +INSERT INTO swiss.team VALUES (16, 271, 279, NULL); +INSERT INTO swiss.team VALUES (16, 272, 254, NULL); +INSERT INTO swiss.team VALUES (16, 273, 260, NULL); +INSERT INTO swiss.team VALUES (16, 274, 282, NULL); +INSERT INTO swiss.team VALUES (16, 275, 264, NULL); +INSERT INTO swiss.team VALUES (16, 276, 267, NULL); +INSERT INTO swiss.team VALUES (17, 277, 311, NULL); +INSERT INTO swiss.team VALUES (17, 278, 313, NULL); +INSERT INTO swiss.team VALUES (17, 279, 302, NULL); +INSERT INTO swiss.team VALUES (17, 280, 305, NULL); +INSERT INTO swiss.team VALUES (17, 281, 300, NULL); +INSERT INTO swiss.team VALUES (17, 282, 291, NULL); +INSERT INTO swiss.team VALUES (17, 283, 294, NULL); +INSERT INTO swiss.team VALUES (17, 284, 289, NULL); +INSERT INTO swiss.team VALUES (17, 285, 310, NULL); +INSERT INTO swiss.team VALUES (17, 286, 285, NULL); +INSERT INTO swiss.team VALUES (17, 287, 295, NULL); +INSERT INTO swiss.team VALUES (17, 288, 306, NULL); +INSERT INTO swiss.team VALUES (17, 289, 308, NULL); +INSERT INTO swiss.team VALUES (17, 290, 315, NULL); +INSERT INTO swiss.team VALUES (17, 291, 288, NULL); +INSERT INTO swiss.team VALUES (17, 292, 292, NULL); +INSERT INTO swiss.team VALUES (18, 293, 314, NULL); +INSERT INTO swiss.team VALUES (18, 294, 312, NULL); +INSERT INTO swiss.team VALUES (18, 295, 287, NULL); +INSERT INTO swiss.team VALUES (18, 296, 303, NULL); +INSERT INTO swiss.team VALUES (18, 297, 293, NULL); +INSERT INTO swiss.team VALUES (18, 298, 286, NULL); +INSERT INTO swiss.team VALUES (18, 299, 304, NULL); +INSERT INTO swiss.team VALUES (18, 300, 299, NULL); +INSERT INTO swiss.team VALUES (18, 301, 284, NULL); +INSERT INTO swiss.team VALUES (18, 302, 298, NULL); +INSERT INTO swiss.team VALUES (18, 303, 290, NULL); +INSERT INTO swiss.team VALUES (18, 304, 301, NULL); +INSERT INTO swiss.team VALUES (18, 305, 296, NULL); +INSERT INTO swiss.team VALUES (18, 306, 297, NULL); +INSERT INTO swiss.team VALUES (18, 307, 309, NULL); +INSERT INTO swiss.team VALUES (18, 308, 307, NULL); +INSERT INTO swiss.team VALUES (19, 309, 266, 265); +INSERT INTO swiss.team VALUES (19, 310, 264, 263); +INSERT INTO swiss.team VALUES (19, 311, 262, 261); +INSERT INTO swiss.team VALUES (19, 312, 260, 259); +INSERT INTO swiss.team VALUES (19, 313, 258, 257); +INSERT INTO swiss.team VALUES (19, 314, 256, 255); +INSERT INTO swiss.team VALUES (19, 315, 254, 253); +INSERT INTO swiss.team VALUES (20, 316, 301, 300); +INSERT INTO swiss.team VALUES (20, 317, 299, 298); +INSERT INTO swiss.team VALUES (20, 318, 297, 296); +INSERT INTO swiss.team VALUES (20, 319, 295, 294); +INSERT INTO swiss.team VALUES (20, 320, 293, 292); +INSERT INTO swiss.team VALUES (20, 321, 291, 290); +INSERT INTO swiss.team VALUES (20, 322, 289, 288); +INSERT INTO swiss.team VALUES (20, 323, 287, 286); +INSERT INTO swiss.team VALUES (20, 324, 285, 284); +INSERT INTO swiss.team VALUES (21, 325, 313, 282); +INSERT INTO swiss.team VALUES (21, 326, 312, 281); +INSERT INTO swiss.team VALUES (21, 327, 311, 280); +INSERT INTO swiss.team VALUES (21, 328, 310, 279); +INSERT INTO swiss.team VALUES (21, 329, 309, 278); +INSERT INTO swiss.team VALUES (21, 330, 308, 277); +INSERT INTO swiss.team VALUES (21, 331, 307, 276); +INSERT INTO swiss.team VALUES (21, 332, 306, 275); +INSERT INTO swiss.team VALUES (21, 333, 305, 274); +INSERT INTO swiss.team VALUES (21, 334, 304, 273); +INSERT INTO swiss.team VALUES (21, 335, 303, 272); +INSERT INTO swiss.team VALUES (21, 336, 302, 271); +INSERT INTO swiss.team VALUES (22, 337, 271, NULL); +INSERT INTO swiss.team VALUES (22, 338, 283, NULL); +INSERT INTO swiss.team VALUES (22, 339, 253, NULL); +INSERT INTO swiss.team VALUES (22, 340, 274, NULL); +INSERT INTO swiss.team VALUES (22, 341, 259, NULL); +INSERT INTO swiss.team VALUES (22, 342, 266, NULL); +INSERT INTO swiss.team VALUES (22, 343, 278, NULL); +INSERT INTO swiss.team VALUES (22, 344, 280, NULL); +INSERT INTO swiss.team VALUES (22, 345, 269, NULL); +INSERT INTO swiss.team VALUES (22, 346, 263, NULL); +INSERT INTO swiss.team VALUES (22, 347, 254, NULL); +INSERT INTO swiss.team VALUES (22, 348, 279, NULL); +INSERT INTO swiss.team VALUES (22, 349, 281, NULL); +INSERT INTO swiss.team VALUES (22, 350, 268, NULL); +INSERT INTO swiss.team VALUES (22, 351, 267, NULL); +INSERT INTO swiss.team VALUES (22, 352, 265, NULL); +INSERT INTO swiss.team VALUES (23, 353, 277, NULL); +INSERT INTO swiss.team VALUES (23, 354, 261, NULL); +INSERT INTO swiss.team VALUES (23, 355, 276, NULL); +INSERT INTO swiss.team VALUES (23, 356, 273, NULL); +INSERT INTO swiss.team VALUES (23, 357, 256, NULL); +INSERT INTO swiss.team VALUES (23, 358, 255, NULL); +INSERT INTO swiss.team VALUES (23, 359, 270, NULL); +INSERT INTO swiss.team VALUES (23, 360, 257, NULL); +INSERT INTO swiss.team VALUES (23, 361, 262, NULL); +INSERT INTO swiss.team VALUES (23, 362, 260, NULL); +INSERT INTO swiss.team VALUES (23, 363, 272, NULL); +INSERT INTO swiss.team VALUES (23, 364, 258, NULL); +INSERT INTO swiss.team VALUES (23, 365, 282, NULL); +INSERT INTO swiss.team VALUES (23, 366, 264, NULL); +INSERT INTO swiss.team VALUES (23, 367, 275, NULL); +INSERT INTO swiss.team VALUES (24, 368, 311, NULL); +INSERT INTO swiss.team VALUES (24, 369, 314, NULL); +INSERT INTO swiss.team VALUES (24, 370, 287, NULL); +INSERT INTO swiss.team VALUES (24, 371, 302, NULL); +INSERT INTO swiss.team VALUES (24, 372, 291, NULL); +INSERT INTO swiss.team VALUES (24, 373, 289, NULL); +INSERT INTO swiss.team VALUES (24, 374, 300, NULL); +INSERT INTO swiss.team VALUES (24, 375, 304, NULL); +INSERT INTO swiss.team VALUES (24, 376, 290, NULL); +INSERT INTO swiss.team VALUES (24, 377, 284, NULL); +INSERT INTO swiss.team VALUES (24, 378, 285, NULL); +INSERT INTO swiss.team VALUES (24, 379, 298, NULL); +INSERT INTO swiss.team VALUES (24, 380, 301, NULL); +INSERT INTO swiss.team VALUES (24, 381, 315, NULL); +INSERT INTO swiss.team VALUES (24, 382, 288, NULL); +INSERT INTO swiss.team VALUES (24, 383, 297, NULL); +INSERT INTO swiss.team VALUES (25, 384, 313, NULL); +INSERT INTO swiss.team VALUES (25, 385, 312, NULL); +INSERT INTO swiss.team VALUES (25, 386, 303, NULL); +INSERT INTO swiss.team VALUES (25, 387, 305, NULL); +INSERT INTO swiss.team VALUES (25, 388, 294, NULL); +INSERT INTO swiss.team VALUES (25, 389, 286, NULL); +INSERT INTO swiss.team VALUES (25, 390, 299, NULL); +INSERT INTO swiss.team VALUES (25, 391, 293, NULL); +INSERT INTO swiss.team VALUES (25, 392, 310, NULL); +INSERT INTO swiss.team VALUES (25, 393, 295, NULL); +INSERT INTO swiss.team VALUES (25, 394, 306, NULL); +INSERT INTO swiss.team VALUES (25, 395, 308, NULL); +INSERT INTO swiss.team VALUES (25, 396, 296, NULL); +INSERT INTO swiss.team VALUES (25, 397, 309, NULL); +INSERT INTO swiss.team VALUES (25, 398, 307, NULL); +INSERT INTO swiss.team VALUES (25, 399, 292, NULL); +INSERT INTO swiss.team VALUES (26, 400, 266, 265); +INSERT INTO swiss.team VALUES (26, 401, 264, 263); +INSERT INTO swiss.team VALUES (26, 402, 262, 261); +INSERT INTO swiss.team VALUES (26, 403, 260, 259); +INSERT INTO swiss.team VALUES (26, 404, 258, 257); +INSERT INTO swiss.team VALUES (26, 405, 256, 255); +INSERT INTO swiss.team VALUES (26, 406, 254, 253); +INSERT INTO swiss.team VALUES (27, 407, 301, 300); +INSERT INTO swiss.team VALUES (27, 408, 299, 298); +INSERT INTO swiss.team VALUES (27, 409, 297, 296); +INSERT INTO swiss.team VALUES (27, 410, 295, 294); +INSERT INTO swiss.team VALUES (27, 411, 293, 292); +INSERT INTO swiss.team VALUES (27, 412, 291, 290); +INSERT INTO swiss.team VALUES (27, 413, 289, 288); +INSERT INTO swiss.team VALUES (27, 414, 287, 286); +INSERT INTO swiss.team VALUES (27, 415, 285, 284); +INSERT INTO swiss.team VALUES (28, 416, 313, 282); +INSERT INTO swiss.team VALUES (28, 417, 312, 281); +INSERT INTO swiss.team VALUES (28, 418, 311, 280); +INSERT INTO swiss.team VALUES (28, 419, 310, 279); +INSERT INTO swiss.team VALUES (28, 420, 309, 278); +INSERT INTO swiss.team VALUES (28, 421, 308, 277); +INSERT INTO swiss.team VALUES (28, 422, 307, 276); +INSERT INTO swiss.team VALUES (28, 423, 306, 275); +INSERT INTO swiss.team VALUES (28, 424, 305, 274); +INSERT INTO swiss.team VALUES (28, 425, 304, 273); +INSERT INTO swiss.team VALUES (28, 426, 303, 272); +INSERT INTO swiss.team VALUES (28, 427, 302, 271); +INSERT INTO swiss.team VALUES (29, 428, 265, NULL); +INSERT INTO swiss.team VALUES (29, 429, 261, NULL); +INSERT INTO swiss.team VALUES (29, 430, 253, NULL); +INSERT INTO swiss.team VALUES (29, 431, 316, NULL); +INSERT INTO swiss.team VALUES (30, 432, 276, 263); +INSERT INTO swiss.team VALUES (30, 433, 265, 254); +INSERT INTO swiss.team VALUES (30, 434, 262, 259); +INSERT INTO swiss.team VALUES (30, 435, 260, 276); +INSERT INTO swiss.team VALUES (30, 436, 253, 316); +INSERT INTO swiss.team VALUES (31, 437, 287, 259); +INSERT INTO swiss.team VALUES (31, 438, 284, 254); +INSERT INTO swiss.team VALUES (31, 439, 276, NULL); +INSERT INTO swiss.team VALUES (31, 440, 260, 299); + + +-- +-- TOC entry 3602 (class 0 OID 17203) +-- Dependencies: 255 +-- Data for Name: tournament; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.tournament VALUES ('2024-12-14', 9, 7, 2, 'Testtoernooi', 'UPCOMING'); +INSERT INTO swiss.tournament VALUES ('2023-12-14', 6, 5, 2, 'Testtoernooi', 'ONGOING'); +INSERT INTO swiss.tournament VALUES ('2024-12-14', 6, 6, 2, 'test 14 december', 'DIVIDED'); +INSERT INTO swiss.tournament VALUES ('2024-12-14', 9, 8, 2, 'Testtoernooi', 'UPCOMING'); + + +-- +-- TOC entry 3626 (class 0 OID 17474) +-- Dependencies: 279 +-- Data for Name: tournament_costs_per_event; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.tournament_costs_per_event VALUES (10, 6); +INSERT INTO swiss.tournament_costs_per_event VALUES (20, 6); +INSERT INTO swiss.tournament_costs_per_event VALUES (0, 6); +INSERT INTO swiss.tournament_costs_per_event VALUES (6, 7); +INSERT INTO swiss.tournament_costs_per_event VALUES (10, 7); +INSERT INTO swiss.tournament_costs_per_event VALUES (0, 7); +INSERT INTO swiss.tournament_costs_per_event VALUES (6, 5); +INSERT INTO swiss.tournament_costs_per_event VALUES (10, 5); +INSERT INTO swiss.tournament_costs_per_event VALUES (0, 5); +INSERT INTO swiss.tournament_costs_per_event VALUES (6, 8); +INSERT INTO swiss.tournament_costs_per_event VALUES (10, 8); +INSERT INTO swiss.tournament_costs_per_event VALUES (0, 8); + + +-- +-- TOC entry 3627 (class 0 OID 17482) +-- Dependencies: 280 +-- Data for Name: tournament_events; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.tournament_events VALUES (21, 5); +INSERT INTO swiss.tournament_events VALUES (22, 5); +INSERT INTO swiss.tournament_events VALUES (23, 5); +INSERT INTO swiss.tournament_events VALUES (24, 5); +INSERT INTO swiss.tournament_events VALUES (25, 5); +INSERT INTO swiss.tournament_events VALUES (26, 6); +INSERT INTO swiss.tournament_events VALUES (27, 6); +INSERT INTO swiss.tournament_events VALUES (28, 6); +INSERT INTO swiss.tournament_events VALUES (29, 6); +INSERT INTO swiss.tournament_events VALUES (30, 6); +INSERT INTO swiss.tournament_events VALUES (31, 7); +INSERT INTO swiss.tournament_events VALUES (32, 7); +INSERT INTO swiss.tournament_events VALUES (33, 7); +INSERT INTO swiss.tournament_events VALUES (34, 7); +INSERT INTO swiss.tournament_events VALUES (35, 7); +INSERT INTO swiss.tournament_events VALUES (36, 8); +INSERT INTO swiss.tournament_events VALUES (37, 8); +INSERT INTO swiss.tournament_events VALUES (38, 8); +INSERT INTO swiss.tournament_events VALUES (39, 8); +INSERT INTO swiss.tournament_events VALUES (40, 8); + + +-- +-- TOC entry 3629 (class 0 OID 17498) +-- Dependencies: 282 +-- Data for Name: tournament_player; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.tournament_player VALUES (false, false, 64, 263, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 65, 253, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 66, 254, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 67, 272, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 68, 293, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 69, 264, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 70, 283, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 71, 256, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 72, 313, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 73, 259, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 74, 261, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 75, 314, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 76, 298, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 77, 295, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 78, 301, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 79, 281, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 80, 300, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 81, 304, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 82, 265, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 83, 258, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 84, 277, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 85, 297, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 86, 299, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 87, 306, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 88, 291, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 89, 280, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 90, 262, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 91, 282, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 92, 292, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 93, 289, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 94, 284, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 95, 288, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 96, 303, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 97, 266, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 98, 285, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 99, 267, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 100, 287, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 101, 305, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 102, 309, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 103, 255, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 104, 275, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 105, 296, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 106, 302, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 107, 290, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 108, 279, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 109, 268, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 110, 269, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 111, 271, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 112, 278, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 113, 260, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 114, 276, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 115, 310, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 116, 257, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 117, 270, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 118, 273, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 119, 286, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 120, 311, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 121, 308, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 122, 294, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 123, 274, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 124, 315, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 125, 312, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 126, 307, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 127, 259, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 128, 271, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 129, 283, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 130, 313, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 131, 290, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 132, 253, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 133, 288, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 134, 306, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 135, 267, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 136, 257, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 137, 264, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 138, 314, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 139, 286, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 140, 305, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 141, 293, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 142, 311, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 143, 300, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 144, 308, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 145, 310, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 146, 282, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 147, 315, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 148, 301, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 149, 274, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 150, 265, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 151, 302, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 152, 260, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 153, 266, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 154, 278, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 155, 268, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 156, 258, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 157, 279, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 158, 277, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 159, 294, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 160, 303, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 161, 281, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 162, 280, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 163, 269, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 164, 284, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 165, 309, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 166, 304, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 167, 261, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 168, 273, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 169, 262, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 170, 295, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 171, 307, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 172, 272, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 173, 263, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 174, 296, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 175, 275, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 176, 289, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 177, 285, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 178, 298, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 179, 292, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 180, 256, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 181, 255, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 182, 254, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 183, 276, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 184, 287, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 185, 299, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 186, 270, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 187, 291, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 188, 297, 5); +INSERT INTO swiss.tournament_player VALUES (false, false, 189, 312, 5); + + +-- +-- TOC entry 3631 (class 0 OID 17528) +-- Dependencies: 284 +-- Data for Name: tournament_player_events; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.tournament_player_events VALUES (64, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (64, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (65, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (65, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (66, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (66, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (67, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (67, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (68, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (68, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (69, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (69, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (70, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (71, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (71, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (72, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (72, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (73, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (73, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (74, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (74, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (75, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (76, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (76, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (77, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (77, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (78, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (78, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (79, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (79, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (80, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (80, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (81, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (81, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (82, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (82, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (83, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (83, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (84, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (84, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (85, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (85, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (86, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (86, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (87, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (87, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (88, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (88, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (89, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (89, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (90, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (90, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (91, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (91, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (92, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (92, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (93, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (93, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (94, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (94, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (95, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (95, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (96, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (96, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (97, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (97, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (98, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (98, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (99, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (100, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (100, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (101, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (101, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (102, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (102, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (103, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (103, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (104, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (104, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (105, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (105, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (106, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (106, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (107, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (107, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (108, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (108, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (109, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (110, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (111, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (111, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (112, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (112, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (113, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (113, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (114, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (114, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (115, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (115, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (116, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (116, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (117, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (118, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (118, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (119, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (119, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (120, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (120, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (121, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (121, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (122, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (122, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (123, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (123, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (124, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (125, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (125, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (126, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (126, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (127, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (127, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (128, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (128, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (129, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (130, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (130, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (131, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (131, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (132, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (132, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (133, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (133, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (134, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (134, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (135, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (136, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (136, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (137, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (137, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (138, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (139, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (139, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (140, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (140, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (141, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (141, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (142, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (142, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (143, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (143, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (144, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (144, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (145, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (145, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (146, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (146, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (147, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (148, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (148, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (149, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (149, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (150, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (150, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (151, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (151, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (152, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (152, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (153, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (153, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (154, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (154, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (155, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (156, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (156, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (157, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (157, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (158, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (158, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (159, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (159, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (160, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (160, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (161, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (161, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (162, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (162, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (163, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (164, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (164, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (165, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (165, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (166, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (166, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (167, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (167, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (168, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (168, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (169, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (169, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (170, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (170, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (171, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (171, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (172, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (172, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (173, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (173, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (174, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (174, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (175, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (175, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (176, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (176, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (177, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (177, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (178, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (178, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (179, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (179, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (180, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (180, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (181, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (181, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (182, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (182, 'HD'); +INSERT INTO swiss.tournament_player_events VALUES (183, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (183, 'GD'); +INSERT INTO swiss.tournament_player_events VALUES (184, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (184, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (185, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (185, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (186, 'HE'); +INSERT INTO swiss.tournament_player_events VALUES (187, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (187, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (188, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (188, 'DD'); +INSERT INTO swiss.tournament_player_events VALUES (189, 'DE'); +INSERT INTO swiss.tournament_player_events VALUES (189, 'GD'); + + +-- +-- TOC entry 3630 (class 0 OID 17513) +-- Dependencies: 283 +-- Data for Name: tournament_tournament_players; Type: TABLE DATA; Schema: swiss; Owner: swiss-user +-- + +INSERT INTO swiss.tournament_tournament_players VALUES (5, 136); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 140); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 148); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 180); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 170); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 177); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 188); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 138); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 175); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 129); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 131); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 135); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 161); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 172); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 149); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 146); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 162); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 181); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 154); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 160); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 185); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 186); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 155); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 176); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 171); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 137); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 141); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 145); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 179); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 169); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 163); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 147); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 130); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 151); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 165); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 153); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 178); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 143); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 183); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 156); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 189); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 159); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 134); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 166); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 158); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 128); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 182); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 142); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 187); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 157); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 150); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 152); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 127); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 173); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 167); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 168); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 139); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 184); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 174); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 164); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 144); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 133); +INSERT INTO swiss.tournament_tournament_players VALUES (5, 132); + + +-- +-- TOC entry 3637 (class 0 OID 0) +-- Dependencies: 256 +-- Name: event_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.event_id_seq', 40, true); + + +-- +-- TOC entry 3638 (class 0 OID 0) +-- Dependencies: 258 +-- Name: eventgroup_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.eventgroup_id_seq', 31, true); + + +-- +-- TOC entry 3639 (class 0 OID 0) +-- Dependencies: 274 +-- Name: game_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.game_id_seq', 1, false); + + +-- +-- TOC entry 3640 (class 0 OID 0) +-- Dependencies: 272 +-- Name: match_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.match_id_seq', 132, true); + + +-- +-- TOC entry 3641 (class 0 OID 0) +-- Dependencies: 252 +-- Name: player_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.player_id_seq', 443, true); + + +-- +-- TOC entry 3642 (class 0 OID 0) +-- Dependencies: 261 +-- Name: registration_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.registration_id_seq', 1118, true); + + +-- +-- TOC entry 3643 (class 0 OID 0) +-- Dependencies: 269 +-- Name: round_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.round_id_seq', 21, true); + + +-- +-- TOC entry 3644 (class 0 OID 0) +-- Dependencies: 266 +-- Name: team_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.team_id_seq', 440, true); + + +-- +-- TOC entry 3645 (class 0 OID 0) +-- Dependencies: 254 +-- Name: tournament_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.tournament_id_seq', 8, true); + + +-- +-- TOC entry 3646 (class 0 OID 0) +-- Dependencies: 281 +-- Name: tournament_player_id_seq; Type: SEQUENCE SET; Schema: swiss; Owner: swiss-user +-- + +SELECT pg_catalog.setval('swiss.tournament_player_id_seq', 189, true); + + +-- +-- TOC entry 3381 (class 2606 OID 17245) +-- Name: event_groups event_groups_groups_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_groups + ADD CONSTRAINT event_groups_groups_id_key UNIQUE (groups_id); + + +-- +-- TOC entry 3377 (class 2606 OID 17220) +-- Name: event event_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event + ADD CONSTRAINT event_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3385 (class 2606 OID 17286) +-- Name: event_registrations event_registrations_registrations_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_registrations + ADD CONSTRAINT event_registrations_registrations_id_key UNIQUE (registrations_id); + + +-- +-- TOC entry 3379 (class 2606 OID 17235) +-- Name: eventgroup eventgroup_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup + ADD CONSTRAINT eventgroup_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3397 (class 2606 OID 17384) +-- Name: eventgroup_rounds eventgroup_rounds_rounds_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_rounds + ADD CONSTRAINT eventgroup_rounds_rounds_id_key UNIQUE (rounds_id); + + +-- +-- TOC entry 3393 (class 2606 OID 17352) +-- Name: eventgroup_teams eventgroup_teams_teams_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_teams + ADD CONSTRAINT eventgroup_teams_teams_id_key UNIQUE (teams_id); + + +-- +-- TOC entry 3370 (class 2606 OID 17190) +-- Name: flyway_schema_history flyway_schema_history_pk; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.flyway_schema_history + ADD CONSTRAINT flyway_schema_history_pk PRIMARY KEY (installed_rank); + + +-- +-- TOC entry 3401 (class 2606 OID 17423) +-- Name: game game_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.game + ADD CONSTRAINT game_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3403 (class 2606 OID 17433) +-- Name: match_games match_games_games_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match_games + ADD CONSTRAINT match_games_games_id_key UNIQUE (games_id); + + +-- +-- TOC entry 3399 (class 2606 OID 17402) +-- Name: match match_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT match_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3387 (class 2606 OID 17301) +-- Name: player_partner_registrations player_partner_registrations_partner_registrations_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_partner_registrations + ADD CONSTRAINT player_partner_registrations_partner_registrations_id_key UNIQUE (partner_registrations_id); + + +-- +-- TOC entry 3373 (class 2606 OID 17201) +-- Name: player player_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player + ADD CONSTRAINT player_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3389 (class 2606 OID 17316) +-- Name: player_registrations player_registrations_registrations_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_registrations + ADD CONSTRAINT player_registrations_registrations_id_key UNIQUE (registrations_id); + + +-- +-- TOC entry 3383 (class 2606 OID 17261) +-- Name: registration registration_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT registration_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3405 (class 2606 OID 17448) +-- Name: round_matches round_matches_matches_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_matches + ADD CONSTRAINT round_matches_matches_id_key UNIQUE (matches_id); + + +-- +-- TOC entry 3395 (class 2606 OID 17369) +-- Name: round round_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round + ADD CONSTRAINT round_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3407 (class 2606 OID 17463) +-- Name: round_quit round_quit_quit_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_quit + ADD CONSTRAINT round_quit_quit_id_key UNIQUE (quit_id); + + +-- +-- TOC entry 3391 (class 2606 OID 17332) +-- Name: team team_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT team_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3409 (class 2606 OID 17486) +-- Name: tournament_events tournament_events_events_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_events + ADD CONSTRAINT tournament_events_events_id_key UNIQUE (events_id); + + +-- +-- TOC entry 3375 (class 2606 OID 17210) +-- Name: tournament tournament_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament + ADD CONSTRAINT tournament_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3411 (class 2606 OID 17502) +-- Name: tournament_player tournament_player_pkey; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player + ADD CONSTRAINT tournament_player_pkey PRIMARY KEY (id); + + +-- +-- TOC entry 3413 (class 2606 OID 17517) +-- Name: tournament_tournament_players tournament_tournament_players_tournament_players_id_key; Type: CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_tournament_players + ADD CONSTRAINT tournament_tournament_players_tournament_players_id_key UNIQUE (tournament_players_id); + + +-- +-- TOC entry 3371 (class 1259 OID 17191) +-- Name: flyway_schema_history_s_idx; Type: INDEX; Schema: swiss; Owner: swiss-user +-- + +CREATE INDEX flyway_schema_history_s_idx ON swiss.flyway_schema_history USING btree (success); + + +-- +-- TOC entry 3431 (class 2606 OID 17353) +-- Name: eventgroup_teams fk2o8i34jh5bk79ya6pc8w3k9of; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_teams + ADD CONSTRAINT fk2o8i34jh5bk79ya6pc8w3k9of FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3433 (class 2606 OID 17370) +-- Name: round fk3w19bu9yiv9px837huabw6abs; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round + ADD CONSTRAINT fk3w19bu9yiv9px837huabw6abs FOREIGN KEY (drawn_out_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3434 (class 2606 OID 17375) +-- Name: round fk3ytfpp2rat10y2x43g7cl61p3; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round + ADD CONSTRAINT fk3ytfpp2rat10y2x43g7cl61p3 FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3424 (class 2606 OID 17307) +-- Name: player_partner_registrations fk61ldsgn3vwru4tjdiraxrsaeb; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_partner_registrations + ADD CONSTRAINT fk61ldsgn3vwru4tjdiraxrsaeb FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3428 (class 2606 OID 17333) +-- Name: team fk6sh9ago3tae2l8og75kbrf4mx; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT fk6sh9ago3tae2l8og75kbrf4mx FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3432 (class 2606 OID 17358) +-- Name: eventgroup_teams fk832tg34v55x5kuma6ia55w4dq; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_teams + ADD CONSTRAINT fk832tg34v55x5kuma6ia55w4dq FOREIGN KEY (teams_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3429 (class 2606 OID 17343) +-- Name: team fk962rmngjyud0ijcw4w7d9vfs0; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT fk962rmngjyud0ijcw4w7d9vfs0 FOREIGN KEY (player2_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3443 (class 2606 OID 17449) +-- Name: round_matches fk9quwtp4ipel9hm56p4oh0f4fh; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_matches + ADD CONSTRAINT fk9quwtp4ipel9hm56p4oh0f4fh FOREIGN KEY (matches_id) REFERENCES swiss.match(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3426 (class 2606 OID 17322) +-- Name: player_registrations fkasxo61ngph7cyje01l1n1ldhg; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_registrations + ADD CONSTRAINT fkasxo61ngph7cyje01l1n1ldhg FOREIGN KEY (registrations_id) REFERENCES swiss.registration(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3448 (class 2606 OID 17492) +-- Name: tournament_events fkb4la5xkmiin27q1du88n7gbxs; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_events + ADD CONSTRAINT fkb4la5xkmiin27q1du88n7gbxs FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3437 (class 2606 OID 17413) +-- Name: match fkci4coem3xydhawrap0y36qlmg; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT fkci4coem3xydhawrap0y36qlmg FOREIGN KEY (team2_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3416 (class 2606 OID 17246) +-- Name: event_groups fkd4r6j627kmoyxt2k0814d8k18; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_groups + ADD CONSTRAINT fkd4r6j627kmoyxt2k0814d8k18 FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3449 (class 2606 OID 17487) +-- Name: tournament_events fkfo9dvc9isnkm8hj8il8ajiea6; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_events + ADD CONSTRAINT fkfo9dvc9isnkm8hj8il8ajiea6 FOREIGN KEY (events_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3417 (class 2606 OID 17251) +-- Name: event_groups fkg4tgtn29hlh54nqxvk3uplupr; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_groups + ADD CONSTRAINT fkg4tgtn29hlh54nqxvk3uplupr FOREIGN KEY (groups_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3441 (class 2606 OID 17439) +-- Name: match_games fkgab11a4ifq5ygm14rpsrvrsuh; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match_games + ADD CONSTRAINT fkgab11a4ifq5ygm14rpsrvrsuh FOREIGN KEY (match_id) REFERENCES swiss.match(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3445 (class 2606 OID 17464) +-- Name: round_quit fkgjta0bnl9jey9c64pmcbbnj5v; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_quit + ADD CONSTRAINT fkgjta0bnl9jey9c64pmcbbnj5v FOREIGN KEY (quit_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3438 (class 2606 OID 17408) +-- Name: match fkglt3t5urqflayn544lpn5ua3s; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT fkglt3t5urqflayn544lpn5ua3s FOREIGN KEY (team1_id) REFERENCES swiss.team(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3452 (class 2606 OID 17523) +-- Name: tournament_tournament_players fkhhmn6g3oxtqiu99ch61h1ubcf; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_tournament_players + ADD CONSTRAINT fkhhmn6g3oxtqiu99ch61h1ubcf FOREIGN KEY (tournament_players_id) REFERENCES swiss.tournament_player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3418 (class 2606 OID 17267) +-- Name: registration fkhmyyu2ljiwo8x10kjfab1pkru; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fkhmyyu2ljiwo8x10kjfab1pkru FOREIGN KEY (partner_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3414 (class 2606 OID 17221) +-- Name: event fkidhc25ppai44aclt55uu9n0fd; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event + ADD CONSTRAINT fkidhc25ppai44aclt55uu9n0fd FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3435 (class 2606 OID 17390) +-- Name: eventgroup_rounds fkkl6r766uq2l1wpe2yals44nyw; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_rounds + ADD CONSTRAINT fkkl6r766uq2l1wpe2yals44nyw FOREIGN KEY (rounds_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3440 (class 2606 OID 17424) +-- Name: game fkkspobx32vu8ykuguwl3u0nuhd; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.game + ADD CONSTRAINT fkkspobx32vu8ykuguwl3u0nuhd FOREIGN KEY (match_id) REFERENCES swiss.match(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3422 (class 2606 OID 17292) +-- Name: event_registrations fkl4jouqv1u8b3wvwv97i1cqmm7; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_registrations + ADD CONSTRAINT fkl4jouqv1u8b3wvwv97i1cqmm7 FOREIGN KEY (registrations_id) REFERENCES swiss.registration(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3427 (class 2606 OID 17317) +-- Name: player_registrations fklc29ku8hopaa9wbmru6dtbax3; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_registrations + ADD CONSTRAINT fklc29ku8hopaa9wbmru6dtbax3 FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3453 (class 2606 OID 17518) +-- Name: tournament_tournament_players fkn7jcr3q0c3lh5gm93t0piyjyt; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_tournament_players + ADD CONSTRAINT fkn7jcr3q0c3lh5gm93t0piyjyt FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3446 (class 2606 OID 17469) +-- Name: round_quit fknkc29tpads6tq669y77d0dvwh; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_quit + ADD CONSTRAINT fknkc29tpads6tq669y77d0dvwh FOREIGN KEY (round_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3425 (class 2606 OID 17302) +-- Name: player_partner_registrations fkohcyc057xfh1bq2gcjjhx90b5; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.player_partner_registrations + ADD CONSTRAINT fkohcyc057xfh1bq2gcjjhx90b5 FOREIGN KEY (partner_registrations_id) REFERENCES swiss.registration(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3439 (class 2606 OID 17403) +-- Name: match fkol8rkyfucvsv37sd7kebpm1nw; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match + ADD CONSTRAINT fkol8rkyfucvsv37sd7kebpm1nw FOREIGN KEY (round_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3430 (class 2606 OID 17338) +-- Name: team fkphn10d6c8k5b758iklivfyn5y; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.team + ADD CONSTRAINT fkphn10d6c8k5b758iklivfyn5y FOREIGN KEY (player1_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3442 (class 2606 OID 17434) +-- Name: match_games fkqt1fsmogbyfoo0w5bilc6rmku; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.match_games + ADD CONSTRAINT fkqt1fsmogbyfoo0w5bilc6rmku FOREIGN KEY (games_id) REFERENCES swiss.game(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3444 (class 2606 OID 17454) +-- Name: round_matches fkr8lyri4t4xil8ajv8e3gjrd47; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.round_matches + ADD CONSTRAINT fkr8lyri4t4xil8ajv8e3gjrd47 FOREIGN KEY (round_id) REFERENCES swiss.round(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3450 (class 2606 OID 17503) +-- Name: tournament_player fkrqw4qfs65btri9sfkbof5xyxq; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player + ADD CONSTRAINT fkrqw4qfs65btri9sfkbof5xyxq FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3451 (class 2606 OID 17508) +-- Name: tournament_player fkrrm3jbmm1fxx5t9t5f8t46ebc; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player + ADD CONSTRAINT fkrrm3jbmm1fxx5t9t5f8t46ebc FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3423 (class 2606 OID 17287) +-- Name: event_registrations fks4kjleulewhu881p4nygwdi0; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.event_registrations + ADD CONSTRAINT fks4kjleulewhu881p4nygwdi0 FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3419 (class 2606 OID 17262) +-- Name: registration fks4x1uat6i8fx26qpdrfwfg3ya; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fks4x1uat6i8fx26qpdrfwfg3ya FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3415 (class 2606 OID 17236) +-- Name: eventgroup fksdpnxwfbha8j4fiwcxkfyknhv; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup + ADD CONSTRAINT fksdpnxwfbha8j4fiwcxkfyknhv FOREIGN KEY (event_id) REFERENCES swiss.event(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3436 (class 2606 OID 17385) +-- Name: eventgroup_rounds fksghgh2lq09c28y7xcsmvwd63s; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.eventgroup_rounds + ADD CONSTRAINT fksghgh2lq09c28y7xcsmvwd63s FOREIGN KEY (group_id) REFERENCES swiss.eventgroup(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3454 (class 2606 OID 17531) +-- Name: tournament_player_events fksihteat3lqwdp92fkp33oglqt; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_player_events + ADD CONSTRAINT fksihteat3lqwdp92fkp33oglqt FOREIGN KEY (tournament_player_id) REFERENCES swiss.tournament_player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3420 (class 2606 OID 17272) +-- Name: registration fkswk5vywwvd2r4knle35xjygao; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fkswk5vywwvd2r4knle35xjygao FOREIGN KEY (player_id) REFERENCES swiss.player(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3421 (class 2606 OID 17277) +-- Name: registration fktfm09huujek0o03wklcg9ewpq; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.registration + ADD CONSTRAINT fktfm09huujek0o03wklcg9ewpq FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- +-- TOC entry 3447 (class 2606 OID 17477) +-- Name: tournament_costs_per_event fkts9nbg8r28e9ncafhnhdohai; Type: FK CONSTRAINT; Schema: swiss; Owner: swiss-user +-- + +ALTER TABLE ONLY swiss.tournament_costs_per_event + ADD CONSTRAINT fkts9nbg8r28e9ncafhnhdohai FOREIGN KEY (tournament_id) REFERENCES swiss.tournament(id) ON DELETE CASCADE; + + +-- Completed on 2024-10-11 16:10:14 UTC + +-- +-- PostgreSQL database dump complete +-- +