From a4beec84d35fbda0631e5cb1bbc2a3354c244e0c Mon Sep 17 00:00:00 2001 From: Roman Vaivod Date: Thu, 14 May 2020 23:54:53 +0200 Subject: [PATCH] Fix test data --- .../1589491059800_add-score-columns.ts | 11 ++ .../1589492439775_set-basic-score.sql | 7 + .../1589492662936_drop-team1won.ts | 14 ++ backend/db_test/test_data.sql | 176 +++++++++--------- backend/repositories/MatchRepository.ts | 2 +- backend/storage/StorageContext.test.ts | 3 +- backend/storage/StorageContext.ts | 4 +- backend/storage/db/db-queries.ts | 5 +- backend/storage/db/db-transformations.ts | 18 +- backend/tests/TestData.ts | 65 +++---- backend/types/Database.ts | 6 +- backend/types/Match.test.ts | 4 +- backend/types/Match.ts | 11 +- 13 files changed, 186 insertions(+), 140 deletions(-) create mode 100644 backend/db_migrations/1589491059800_add-score-columns.ts create mode 100644 backend/db_migrations/1589492439775_set-basic-score.sql create mode 100644 backend/db_migrations/1589492662936_drop-team1won.ts diff --git a/backend/db_migrations/1589491059800_add-score-columns.ts b/backend/db_migrations/1589491059800_add-score-columns.ts new file mode 100644 index 00000000..97f2c14d --- /dev/null +++ b/backend/db_migrations/1589491059800_add-score-columns.ts @@ -0,0 +1,11 @@ +/* eslint-disable @typescript-eslint/camelcase */ +import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate' + +export const shorthands: ColumnDefinitions | undefined = undefined + +export async function up(pgm: MigrationBuilder): Promise { + pgm.addColumns('Matches', { + Team1Score: { type: 'integer' }, + Team2Score: { type: 'integer' }, + }) +} diff --git a/backend/db_migrations/1589492439775_set-basic-score.sql b/backend/db_migrations/1589492439775_set-basic-score.sql new file mode 100644 index 00000000..50a69e25 --- /dev/null +++ b/backend/db_migrations/1589492439775_set-basic-score.sql @@ -0,0 +1,7 @@ +UPDATE "Matches" +SET "Team1Score" = '1', "Team2Score" = '0' +WHERE "Team1Won" = 'true'; + +UPDATE "Matches" +SET "Team1Score" = '0', "Team2Score" = '1' +WHERE "Team1Won" = 'false'; diff --git a/backend/db_migrations/1589492662936_drop-team1won.ts b/backend/db_migrations/1589492662936_drop-team1won.ts new file mode 100644 index 00000000..e7afff7c --- /dev/null +++ b/backend/db_migrations/1589492662936_drop-team1won.ts @@ -0,0 +1,14 @@ +/* eslint-disable @typescript-eslint/camelcase */ +import { MigrationBuilder, ColumnDefinitions } from 'node-pg-migrate' + +export const shorthands: ColumnDefinitions | undefined = undefined + +export async function up(pgm: MigrationBuilder): Promise { + pgm.dropColumns('Matches', ['Team1Won']) + pgm.alterColumn('Matches', 'Team1Score', { + notNull: true, + }) + pgm.alterColumn('Matches', 'Team2Score', { + notNull: true, + }) +} diff --git a/backend/db_test/test_data.sql b/backend/db_test/test_data.sql index d1d8e14c..afb4bdea 100644 --- a/backend/db_test/test_data.sql +++ b/backend/db_test/test_data.sql @@ -61,94 +61,94 @@ INSERT INTO "Players"("Id","Rating","InitialRating", "GameId", "UserId") VALUES INSERT INTO "Players"("Id","Rating","InitialRating", "GameId", "UserId") VALUES ('14','1094','963','1','24'); -- Foosball matches -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('298','14','1083','5','979','8','1030','23','1051','2019-09-02 10:29:50.486','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('299','11','1076','10','973','5','995','9','1050','2019-09-02 13:10:46.237','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('300','21','856','22','853','16','693','20','867','2019-09-02 15:07:10.464','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('301','13','1018','9','1034','23','1035','5','979','2019-09-02 16:01:39.864','15','true','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('302','12','1003','14','1099','8','1014','7','1302','2019-09-03 09:17:29.416','21','true','-21', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('303','10','989','13','1033','23','1020','16','680','2019-09-04 15:39:31.303','23','false','-23', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('304','9','1049','23','1043','15','891','14','1120','2019-09-05 11:56:11.343','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('305','11','1092','22','866','15','877','21','869','2019-09-06 11:54:25.379','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('306','21','858','15','866','13','1010','16','703','2019-09-06 14:47:55.402','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('307','22','877','20','854','15','882','16','687','2019-09-09 10:02:55.271','12','true','-12', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('308','9','1063','8','993','23','1057','13','994','2019-09-09 11:24:52.137','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('309','11','1103','6','1275','14','1106','22','889','2019-09-09 14:30:19.756','8','true','-8', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('311','15','852','14','1098','9','1079','22','881','2019-09-10 13:02:19.941','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('312','16','693','9','1063','22','865','15','868','2019-09-11 12:57:13.607','15','true','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('313','13','978','8','1009','23','1041','16','708','2019-09-11 15:29:02.857','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('314','23','1030','10','984','9','1078','22','850','2019-09-12 12:08:51.389','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('315','11','1111','23','1044','14','1114','13','989','2019-09-12 15:46:10.526','15','true','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('316','21','856','11','1126','10','998','9','1064','2019-09-13 11:04:24.882','18','true','-18', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('317','11','1144','23','1059','13','974','14','1099','2019-09-13 14:09:23.956','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('318','23','1072','15','853','9','1046','13','961','2019-09-16 15:59:49.578','18','true','-18', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('319','7','1281','11','1157','6','1283','15','871','2019-09-17 18:04:25.93','10','true','-10', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('320','15','861','6','1273','14','1086','9','1028','2019-09-19 10:25:29.731','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('321','13','943','9','1012','15','877','6','1289','2019-09-19 15:34:05.228','21','true','-21', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('322','7','1291','9','1033','11','1167','6','1268','2019-09-20 12:13:04.865','19','true','-19', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('323','13','964','15','856','10','980','16','697','2019-09-20 12:48:53.371','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('324','16','684','6','1249','9','1052','10','967','2019-09-23 09:14:19.769','14','false','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('325','23','1090','10','981','16','670','6','1235','2019-09-23 13:41:13.966','12','true','-12', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('326','10','993',NULL,NULL,'16','658',NULL,NULL,'2019-09-23 13:57:35.313','4','true','-4', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('327','15','869','22','836','16','654','10','997','2019-09-24 09:10:53.533','15','true','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('328','7','1310','15','884','23','1102','10','982','2019-09-24 14:48:03.163','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('329','14','1070','16','639','8','1020','20','866','2019-09-24 15:37:15.747','20','true','-20', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('330','8','1000','7','1323','14','1090','6','1223','2019-09-25 12:44:24.448','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('331','10','969','23','1089','9','1066','13','977','2019-09-25 13:46:40.801','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('364','22','851','6','1207','10','985','13','961','2019-09-26 13:49:38.422','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('365','6','1220','16','659','10','972','15','897','2019-09-27 11:43:34.41','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('367','11','1148','23','1105','6','1236','13','948','2019-09-30 12:52:38.859','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('368','23','1119','6','1222','7','1339','21','874','2019-09-30 13:12:01.437','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('369','10','956',NULL,NULL,'21','861',NULL,NULL,'2019-10-01 07:49:54.767','12','true','-12', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('370','6','1235','21','849','10','968','15','881','2019-10-01 12:13:59.608','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('371','6','1246','14','1074','7','1326','8','1016','2019-10-01 15:04:07.898','17','true','-17', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('372','11','1162','6','1263','7','1309','15','870','2019-10-01 20:15:43.512','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('373','8','999','9','1050','11','1173','16','675','2019-10-02 12:58:09.756','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('374','23','1132','15','859','10','957','5','964','2019-10-02 14:52:34.194','18','false','-18', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('375','13','934','15','841','11','1162','16','664','2019-10-03 15:53:51.176','17','true','-17', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('376','10','975',NULL,NULL,'5','982',NULL,NULL,'2019-10-04 10:20:48.868','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('377','15','858','23','1114','21','860','22','864','2019-10-04 12:45:26.712','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('378','14','1091','16','647','13','951','22','853','2019-10-04 15:22:57.665','18','true','-18', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('379','9','1061','6','1274','11','1145','14','1109','2019-10-07 10:21:52.809','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('380','10','991','24','1000','16','665','20','846','2019-10-07 11:43:19.329','6','true','-6', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('381','11','1131','6','1288','7','1298','22','835','2019-10-07 15:30:32.097','10','true','-10', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('382','24','1006','16','659','15','869','20','840','2019-10-08 08:27:19.687','15','false','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('383','21','849','7','1288','9','1075','13','933','2019-10-08 11:59:25.292','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('385','6','1312','21','862','11','1141','13','920','2019-10-10 15:38:49.24','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('386','9','1062','16','658','15','870','21','875','2019-10-11 09:13:11.817','17','true','-17', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('387','11','1128','5','966','9','1079','10','997','2019-10-11 12:10:27.07','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('388','6','1325','15','853','8','1010','5','982','2019-10-14 14:52:13.58','12','true','-12', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('389','6','1337','8','998','7','1301','11','1144','2019-10-15 13:40:07.295','19','true','-19', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('390','22','825','6','1356','21','858','10','981','2019-10-15 15:46:50.125','9','true','-9', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('391','15','865','22','834','12','1024','14','1095','2019-10-16 12:34:03.014','7','false','-7', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('392','6','1365','10','972','9','1063','8','1017','2019-10-16 13:28:06.791','10','true','-10', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('393','6','1375','16','675','5','970','15','858','2019-10-17 15:29:45.238','11','true','-11', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('394','10','982','21','849','20','855','13','907','2019-10-17 16:13:30.169','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('395','6','1386','22','827','9','1053','21','863','2019-10-21 14:44:15.301','10','true','-10', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('397','22','837','5','959','10','983','16','699','2019-10-22 12:36:39.496','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('398','16','686','7','1295','15','834','23','1125','2019-10-22 15:35:16.362','15','true','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('399','15','819','7','1310','21','853','10','970','2019-10-23 13:17:02.335','9','true','-9', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('400','7','1319','10','961','14','1102','23','1110','2019-10-23 15:52:29.963','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('401','9','1043','22','850','24','977','10','975','2019-10-24 13:14:50.308','17','true','-17', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('434','6','1396','5','972','14','1088','23','1096','2019-10-25 14:04:56.953','12','true','-12', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('435','7','1333','5','984','6','1408','15','828','2019-10-29 10:25:02.474','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('436','9','1060','22','867','8','1007','10','958','2019-10-29 13:28:28.874','17','true','-17', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('437','13','893','7','1347','6','1394','15','814','2019-10-29 16:03:00.575','15','true','-15', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('438','15','799','7','1362','23','1084','10','941','2019-10-30 10:35:24.213','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('439','23','1071','7','1375','14','1076','9','1077','2019-10-30 13:43:16.825','10','true','-10', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('440','6','1379','15','812','23','1081','5','998','2019-10-31 12:17:56.513','13','true','-13', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('441','11','1125','14','1066','6','1392','5','985','2019-10-31 16:22:17.083','20','true','-20', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('442','22','884','9','1067','5','965','13','908','2019-11-01 12:31:01.34','14','true','-14', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('443','15','825','6','1372','10','928','21','844','2019-11-01 14:19:33.986','7','true','-7', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('444','22','898','7','1385','6','1379','10','921','2019-11-04 12:05:38.816','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('445','5','951','13','894','9','1081','21','837','2019-11-04 13:45:37.201','18','true','-18', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('446','6','1363','11','1145','7','1401','14','1086','2019-11-04 16:26:20.909','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('447','15','832','7','1385','5','969','22','914','2019-11-05 12:59:01.638','9','true','-9', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('448','6','1379','22','905','14','1070','5','960','2019-11-05 15:53:46.953','10','true','-10', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('449','11','1161','6','1389','7','1394','15','841','2019-11-05 20:44:23.939','9','true','-9', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('450','14','1060','12','1031','15','832','22','915','2019-11-06 13:30:41.325','9','true','-9', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('451','15','823','23','1068','7','1385','21','819','2019-11-06 13:57:41.732','9','false','-9', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('452','15','814','9','1063','5','950','22','906','2019-11-07 16:15:51.246','16','true','-16', '1'); -INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('453','9','1079','15','830','24','960','22','890','2019-11-08 12:16:44.265','15','true','-15', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('298','14','1083','5','979','8','1030','23','1051','2019-09-02 10:29:50.486','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('299','11','1076','10','973','5','995','9','1050','2019-09-02 13:10:46.237','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('300','21','856','22','853','16','693','20','867','2019-09-02 15:07:10.464','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('301','13','1018','9','1034','23','1035','5','979','2019-09-02 16:01:39.864','15','-15', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('302','12','1003','14','1099','8','1014','7','1302','2019-09-03 09:17:29.416','21','-21', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('303','10','989','13','1033','23','1020','16','680','2019-09-04 15:39:31.303','23','-23', '1', '0', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('304','9','1049','23','1043','15','891','14','1120','2019-09-05 11:56:11.343','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('305','11','1092','22','866','15','877','21','869','2019-09-06 11:54:25.379','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('306','21','858','15','866','13','1010','16','703','2019-09-06 14:47:55.402','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('307','22','877','20','854','15','882','16','687','2019-09-09 10:02:55.271','12','-12', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('308','9','1063','8','993','23','1057','13','994','2019-09-09 11:24:52.137','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('309','11','1103','6','1275','14','1106','22','889','2019-09-09 14:30:19.756','8','-8', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('311','15','852','14','1098','9','1079','22','881','2019-09-10 13:02:19.941','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('312','16','693','9','1063','22','865','15','868','2019-09-11 12:57:13.607','15','-15', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('313','13','978','8','1009','23','1041','16','708','2019-09-11 15:29:02.857','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('314','23','1030','10','984','9','1078','22','850','2019-09-12 12:08:51.389','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('315','11','1111','23','1044','14','1114','13','989','2019-09-12 15:46:10.526','15','-15', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('316','21','856','11','1126','10','998','9','1064','2019-09-13 11:04:24.882','18','-18', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('317','11','1144','23','1059','13','974','14','1099','2019-09-13 14:09:23.956','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('318','23','1072','15','853','9','1046','13','961','2019-09-16 15:59:49.578','18','-18', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('319','7','1281','11','1157','6','1283','15','871','2019-09-17 18:04:25.93','10','-10', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('320','15','861','6','1273','14','1086','9','1028','2019-09-19 10:25:29.731','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('321','13','943','9','1012','15','877','6','1289','2019-09-19 15:34:05.228','21','-21', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('322','7','1291','9','1033','11','1167','6','1268','2019-09-20 12:13:04.865','19','-19', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('323','13','964','15','856','10','980','16','697','2019-09-20 12:48:53.371','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('324','16','684','6','1249','9','1052','10','967','2019-09-23 09:14:19.769','14','-14', '1', '0', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('325','23','1090','10','981','16','670','6','1235','2019-09-23 13:41:13.966','12','-12', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('326','10','993',NULL,NULL,'16','658',NULL,NULL,'2019-09-23 13:57:35.313','4','-4', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('327','15','869','22','836','16','654','10','997','2019-09-24 09:10:53.533','15','-15', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('328','7','1310','15','884','23','1102','10','982','2019-09-24 14:48:03.163','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('329','14','1070','16','639','8','1020','20','866','2019-09-24 15:37:15.747','20','-20', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('330','8','1000','7','1323','14','1090','6','1223','2019-09-25 12:44:24.448','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('331','10','969','23','1089','9','1066','13','977','2019-09-25 13:46:40.801','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('364','22','851','6','1207','10','985','13','961','2019-09-26 13:49:38.422','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('365','6','1220','16','659','10','972','15','897','2019-09-27 11:43:34.41','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('367','11','1148','23','1105','6','1236','13','948','2019-09-30 12:52:38.859','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('368','23','1119','6','1222','7','1339','21','874','2019-09-30 13:12:01.437','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('369','10','956',NULL,NULL,'21','861',NULL,NULL,'2019-10-01 07:49:54.767','12','-12', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('370','6','1235','21','849','10','968','15','881','2019-10-01 12:13:59.608','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('371','6','1246','14','1074','7','1326','8','1016','2019-10-01 15:04:07.898','17','-17', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('372','11','1162','6','1263','7','1309','15','870','2019-10-01 20:15:43.512','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('373','8','999','9','1050','11','1173','16','675','2019-10-02 12:58:09.756','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('374','23','1132','15','859','10','957','5','964','2019-10-02 14:52:34.194','18','-18', '1', '0', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('375','13','934','15','841','11','1162','16','664','2019-10-03 15:53:51.176','17','-17', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('376','10','975',NULL,NULL,'5','982',NULL,NULL,'2019-10-04 10:20:48.868','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('377','15','858','23','1114','21','860','22','864','2019-10-04 12:45:26.712','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('378','14','1091','16','647','13','951','22','853','2019-10-04 15:22:57.665','18','-18', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('379','9','1061','6','1274','11','1145','14','1109','2019-10-07 10:21:52.809','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('380','10','991','24','1000','16','665','20','846','2019-10-07 11:43:19.329','6','-6', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('381','11','1131','6','1288','7','1298','22','835','2019-10-07 15:30:32.097','10','-10', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('382','24','1006','16','659','15','869','20','840','2019-10-08 08:27:19.687','15','-15', '1', '0', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('383','21','849','7','1288','9','1075','13','933','2019-10-08 11:59:25.292','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('385','6','1312','21','862','11','1141','13','920','2019-10-10 15:38:49.24','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('386','9','1062','16','658','15','870','21','875','2019-10-11 09:13:11.817','17','-17', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('387','11','1128','5','966','9','1079','10','997','2019-10-11 12:10:27.07','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('388','6','1325','15','853','8','1010','5','982','2019-10-14 14:52:13.58','12','-12', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('389','6','1337','8','998','7','1301','11','1144','2019-10-15 13:40:07.295','19','-19', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('390','22','825','6','1356','21','858','10','981','2019-10-15 15:46:50.125','9','-9', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('391','15','865','22','834','12','1024','14','1095','2019-10-16 12:34:03.014','7','-7', '1', '0', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('392','6','1365','10','972','9','1063','8','1017','2019-10-16 13:28:06.791','10','-10', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('393','6','1375','16','675','5','970','15','858','2019-10-17 15:29:45.238','11','-11', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('394','10','982','21','849','20','855','13','907','2019-10-17 16:13:30.169','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('395','6','1386','22','827','9','1053','21','863','2019-10-21 14:44:15.301','10','-10', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('397','22','837','5','959','10','983','16','699','2019-10-22 12:36:39.496','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('398','16','686','7','1295','15','834','23','1125','2019-10-22 15:35:16.362','15','-15', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('399','15','819','7','1310','21','853','10','970','2019-10-23 13:17:02.335','9','-9', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('400','7','1319','10','961','14','1102','23','1110','2019-10-23 15:52:29.963','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('401','9','1043','22','850','24','977','10','975','2019-10-24 13:14:50.308','17','-17', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('434','6','1396','5','972','14','1088','23','1096','2019-10-25 14:04:56.953','12','-12', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('435','7','1333','5','984','6','1408','15','828','2019-10-29 10:25:02.474','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('436','9','1060','22','867','8','1007','10','958','2019-10-29 13:28:28.874','17','-17', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('437','13','893','7','1347','6','1394','15','814','2019-10-29 16:03:00.575','15','-15', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('438','15','799','7','1362','23','1084','10','941','2019-10-30 10:35:24.213','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('439','23','1071','7','1375','14','1076','9','1077','2019-10-30 13:43:16.825','10','-10', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('440','6','1379','15','812','23','1081','5','998','2019-10-31 12:17:56.513','13','-13', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('441','11','1125','14','1066','6','1392','5','985','2019-10-31 16:22:17.083','20','-20', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('442','22','884','9','1067','5','965','13','908','2019-11-01 12:31:01.34','14','-14', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('443','15','825','6','1372','10','928','21','844','2019-11-01 14:19:33.986','7','-7', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('444','22','898','7','1385','6','1379','10','921','2019-11-04 12:05:38.816','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('445','5','951','13','894','9','1081','21','837','2019-11-04 13:45:37.201','18','-18', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('446','6','1363','11','1145','7','1401','14','1086','2019-11-04 16:26:20.909','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('447','15','832','7','1385','5','969','22','914','2019-11-05 12:59:01.638','9','-9', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('448','6','1379','22','905','14','1070','5','960','2019-11-05 15:53:46.953','10','-10', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('449','11','1161','6','1389','7','1394','15','841','2019-11-05 20:44:23.939','9','-9', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('450','14','1060','12','1031','15','832','22','915','2019-11-06 13:30:41.325','9','-9', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('451','15','823','23','1068','7','1385','21','819','2019-11-06 13:57:41.732','9','-9', '1', '0', '1'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('452','15','814','9','1063','5','950','22','906','2019-11-07 16:15:51.246','16','-16', '1', '1', '0'); +INSERT INTO "Matches"("Id","Team1Player1Id","Team1Player1Rating","Team1Player2Id","Team1Player2Rating","Team2Player1Id","Team2Player1Rating","Team2Player2Id","Team2Player2Rating","Date","WinningTeamRatingChange","Team1Won","LosingTeamRatingChange", "GameId") VALUES ('453','9','1079','15','830','24','960','22','890','2019-11-08 12:16:44.265','15','-15', '1', '1', '0'); -- Tennis players INSERT INTO "Players"("Id","Rating","InitialRating", "GameId", "UserId") VALUES ('120','1040','971','3','60'); diff --git a/backend/repositories/MatchRepository.ts b/backend/repositories/MatchRepository.ts index e9fe6aad..71ffa3e3 100644 --- a/backend/repositories/MatchRepository.ts +++ b/backend/repositories/MatchRepository.ts @@ -41,7 +41,7 @@ Promise => { return new Match( team1, team2, - matchDescription.team1Won, + matchDescription.team1Won? { team1Score: 1, team2Score: 0 } : { team1Score: 0, team2Score: 1 }, date, winningTeamRatingChange, losingTeamRatingChange, diff --git a/backend/storage/StorageContext.test.ts b/backend/storage/StorageContext.test.ts index dc14bbaf..7b674e66 100644 --- a/backend/storage/StorageContext.test.ts +++ b/backend/storage/StorageContext.test.ts @@ -272,8 +272,9 @@ describe('StorageContext', () => { FOOSBALL_MATCH.date, FOOSBALL_MATCH.winningTeamRatingChange, FOOSBALL_MATCH.losingTeamRatingChange, - FOOSBALL_MATCH.team1Won, FOOSBALL_MATCH.gameId, + FOOSBALL_MATCH.score.team1Score, + FOOSBALL_MATCH.score.team2Score, ]) }) it('returns match with id', () => { diff --git a/backend/storage/StorageContext.ts b/backend/storage/StorageContext.ts index cc672e52..42ad13a3 100644 --- a/backend/storage/StorageContext.ts +++ b/backend/storage/StorageContext.ts @@ -180,8 +180,8 @@ export class StorageContext { const query = dbQueries.insertMatch const values = [team1Player1.id, team1Player1.rating, team1Player2.id, team1Player2.rating, team2Player1.id, team2Player1.rating, team2Player2.id, team2Player2.rating, - match.date, match.winningTeamRatingChange, match.losingTeamRatingChange, match.team1Won, - match.gameId] + match.date, match.winningTeamRatingChange, match.losingTeamRatingChange, + match.gameId, match.score.team1Score, match.score.team2Score] let row try { diff --git a/backend/storage/db/db-queries.ts b/backend/storage/db/db-queries.ts index 3eaa915a..67e52da6 100644 --- a/backend/storage/db/db-queries.ts +++ b/backend/storage/db/db-queries.ts @@ -17,9 +17,10 @@ export const insertMatch = oneLine` INSERT INTO "Matches"( "Team1Player1Id", "Team1Player1Rating", "Team1Player2Id", "Team1Player2Rating", "Team2Player1Id", "Team2Player1Rating", "Team2Player2Id", "Team2Player2Rating", - "Date", "WinningTeamRatingChange", "LosingTeamRatingChange", "Team1Won", "GameId" + "Date", "WinningTeamRatingChange", "LosingTeamRatingChange", "GameId", + "Team1Score", "Team2Score" ) - VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING * + VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14) RETURNING * ` export const selectAllMatches = 'SELECT * FROM "Matches"' diff --git a/backend/storage/db/db-transformations.ts b/backend/storage/db/db-transformations.ts index fa18ff98..b5ba38a6 100644 --- a/backend/storage/db/db-transformations.ts +++ b/backend/storage/db/db-transformations.ts @@ -48,27 +48,27 @@ export const createMatchFromDbRow = (matchRow: QueryResultRow): MatchWithId => { matchRating: Number(matchRow.Team2Player2Rating), }] : [] - return { - id: Number(matchRow.Id), - team1: [ + return new MatchWithId( + Number(matchRow.Id), + [ { id: Number(matchRow.Team1Player1Id), matchRating: Number(matchRow.Team1Player1Rating), }, ...team1Player2Array, ], - team2: [ + [ { id: Number(matchRow.Team2Player1Id), matchRating: Number(matchRow.Team2Player1Rating), }, ...team2Player2Array, ], - date: matchRow.Date, - winningTeamRatingChange: Number(matchRow.WinningTeamRatingChange), - losingTeamRatingChange: Number(matchRow.LosingTeamRatingChange), - team1Won: Boolean(matchRow.Team1Won), - } + matchRow.Team1Score > matchRow.Team2Score, + matchRow.Date, + Number(matchRow.WinningTeamRatingChange), + Number(matchRow.LosingTeamRatingChange), + ) } export const createGameFromDbRow = (gameRow: QueryResultRow): Game => { diff --git a/backend/tests/TestData.ts b/backend/tests/TestData.ts index 13650e26..2f0187fa 100644 --- a/backend/tests/TestData.ts +++ b/backend/tests/TestData.ts @@ -2,7 +2,7 @@ import { MatchWithId, Match } from '../types/Match' import { Player } from '../types/Player' import { MatchDescription } from '../types/MatchDescription' import * as moment from 'moment' -import { UserRow } from '../types/Database' +import { UserRow, MatchRow } from '../types/Database' const NOW_MOMENT = moment('2020-03-25 10:00:00') export const NOW = NOW_MOMENT.toDate() @@ -25,21 +25,22 @@ export const FOOSBALL_GAME = { ...FOOSBALL_DATA, } -export const FOOSBALL_MATCH_ROW = { +export const FOOSBALL_MATCH_ROW: MatchRow = { Id: '2', - Team1Player1Id: '1', - Team1Player1Rating: '1001', - Team1Player2Id: '2', - Team1Player2Rating: '1002', - Team2Player1Id: '3', - Team2Player1Rating: '1003', - Team2Player2Id: '4', - Team2Player2Rating: '1004', + Team1Player1Id: 1, + Team1Player1Rating: 1001, + Team1Player2Id: 2, + Team1Player2Rating: 1002, + Team2Player1Id: 3, + Team2Player1Rating: 1003, + Team2Player2Id: 4, + Team2Player2Rating: 1004, Date: NOW, - WinningTeamRatingChange: '16', - LosingTeamRatingChange: '-16', - Team1Won: 'true', - GameId: '1', + WinningTeamRatingChange: 16, + LosingTeamRatingChange: -16, + Team1Score: 1, + Team2Score: 0, + GameId: 1, } export const FOOSBALL_MATCH_DESCRIPTION: MatchDescription = { @@ -48,15 +49,15 @@ export const FOOSBALL_MATCH_DESCRIPTION: MatchDescription = { team1Won: true, } -export const FOOSBALL_MATCH_WITH_ID: MatchWithId = { - id: 2, - team1:[ { id: 1, matchRating: 1001 }, { id: 2, matchRating: 1002 }], - team2:[ { id: 3, matchRating: 1003 }, { id: 4, matchRating: 1004 }], - team1Won: true, - date: NOW, - winningTeamRatingChange: 16, - losingTeamRatingChange: -16, -} +export const FOOSBALL_MATCH_WITH_ID = new MatchWithId( + 2, + [ { id: 1, matchRating: 1001 }, { id: 2, matchRating: 1002 }], + [ { id: 3, matchRating: 1003 }, { id: 4, matchRating: 1004 }], + true, + NOW, + 16, + -16, +) export const TONDA_PLAYER_ROW = { Id: '3', @@ -106,15 +107,15 @@ export const PETR_PLAYER: Player = { initialRating: 1200, } -export const FOOSBALL_MATCH: Match = { - team1: [ TONDA_PLAYER ], - team2: [ RADEK_PLAYER, PETR_PLAYER], - team1Won: true, - date: FOOSBALL_MATCH_ROW.Date, - winningTeamRatingChange: 16, - losingTeamRatingChange: -16, - gameId: 1, -} +export const FOOSBALL_MATCH = new Match( + [ TONDA_PLAYER ], + [ RADEK_PLAYER, PETR_PLAYER], + { team1Score: 1, team2Score: 0 }, + FOOSBALL_MATCH_ROW.Date, + 16, + -16, + 1, +) export const TONDA_USER_ROW: UserRow = { Id: 4, diff --git a/backend/types/Database.ts b/backend/types/Database.ts index 50469294..c2444e21 100644 --- a/backend/types/Database.ts +++ b/backend/types/Database.ts @@ -41,8 +41,9 @@ export interface MatchRow { Date: Date; WinningTeamRatingChange: number; LosingTeamRatingChange: number; - Team1Won: boolean; GameId: number; + Team1Score: number; + Team2Score: number; } export const isValidMatchRow = (queryRow: QueryResultRow): queryRow is MatchRow => { @@ -58,7 +59,8 @@ export const isValidMatchRow = (queryRow: QueryResultRow): queryRow is MatchRow queryRow.Date && queryRow.WinningTeamRatingChange !== undefined && queryRow.LosingTeamRatingChange !== undefined && - queryRow.Team1Won !== undefined + queryRow.Team1Score !== undefined && + queryRow.Team2Score !== undefined } export interface GameRow { diff --git a/backend/types/Match.test.ts b/backend/types/Match.test.ts index 3a5a22ad..fa66db14 100644 --- a/backend/types/Match.test.ts +++ b/backend/types/Match.test.ts @@ -16,7 +16,7 @@ describe('Match', () => { expect(() => new Match( data.team1, data.team2, - data.team1Won, + data.score, data.date, data.winningTeamRatingChange, data.losingTeamRatingChange, @@ -27,7 +27,7 @@ describe('Match', () => { expect(new Match( FOOSBALL_MATCH.team1, FOOSBALL_MATCH.team2, - FOOSBALL_MATCH.team1Won, + FOOSBALL_MATCH.score, FOOSBALL_MATCH.date, FOOSBALL_MATCH.winningTeamRatingChange, FOOSBALL_MATCH.losingTeamRatingChange, diff --git a/backend/types/Match.ts b/backend/types/Match.ts index a55e9165..3a0c7f22 100644 --- a/backend/types/Match.ts +++ b/backend/types/Match.ts @@ -2,11 +2,16 @@ import { UserInMatches } from './User' import { Player } from './Player' import { InputError } from '../errors/InputError' +interface Score { + team1Score: number; + team2Score: number; +} + export class Match { constructor( readonly team1: Array, readonly team2: Array, - readonly team1Won: boolean, + readonly score: Score, readonly date: Date, readonly winningTeamRatingChange: number, readonly losingTeamRatingChange: number, @@ -19,6 +24,10 @@ export class Match { throw new InputError('Inserting teams with unsupported number of players') } } + + get team1Won(): boolean { + return this.score.team1Score > this.score.team2Score + } } export class MatchWithId {