Skip to content

Commit 43cdb5e

Browse files
committed
Seed 2025 season
1 parent eca3b78 commit 43cdb5e

5 files changed

Lines changed: 332 additions & 12 deletions

File tree

bun.lockb

-158 KB
Binary file not shown.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
'use strict';
2+
3+
const fs = require('fs');
4+
const parse = require('csv-parse/lib/sync')
5+
6+
var dbm;
7+
var type;
8+
var seed;
9+
10+
/**
11+
* We receive the dbmigrate dependency from dbmigrate initially.
12+
* This enables us to not have to rely on NODE_PATH.
13+
*/
14+
exports.setup = function(options, seedLink) {
15+
dbm = options.dbmigrate;
16+
type = dbm.dataType;
17+
seed = seedLink;
18+
};
19+
20+
exports.up = async function(db) {
21+
const games = parse(fs.readFileSync('./seed_data/nfl_2025.csv'));
22+
23+
for (const game of games) {
24+
await db.insert('sports_games', [
25+
'season',
26+
'week',
27+
'start_time',
28+
'away_team_short_name',
29+
'home_team_short_name'
30+
], [
31+
2025,
32+
game[0],
33+
game[1],
34+
game[2],
35+
game[3]
36+
]);
37+
}
38+
39+
return null;
40+
};
41+
42+
exports.down = function(db) {
43+
return null;
44+
};
45+
46+
exports._meta = {
47+
"version": 1
48+
};

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
},
1818
"homepage": "https://github.com/StephenBarlow/metagame#readme",
1919
"dependencies": {
20-
"apollo-server": "^3.10.1",
21-
"async": "^3.1.0",
20+
"apollo-server": "^3.13.0",
21+
"async": "^3.2.6",
2222
"bunyan": "^1.8.15",
23-
"csv-parse": "^4.12.0",
24-
"datasource-sql": "^1.4.1",
25-
"db-migrate": "^0.11.11",
26-
"db-migrate-pg": "^1.2.2",
23+
"csv-parse": "^4.16.3",
24+
"datasource-sql": "^1.6.0",
25+
"db-migrate": "^0.11.14",
26+
"db-migrate-pg": "^1.5.2",
2727
"dotenv": "^9.0.2",
2828
"email-validator": "^2.0.4",
29-
"graphql": "^16.6.0",
30-
"pg": "^8.6.0"
29+
"graphql": "^16.9.0",
30+
"pg": "^8.12.0"
3131
}
3232
}

resolvers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ async function validatePickTwoPick(pickRequest, pg, context) {
317317
if (hasGame) {
318318
pickedGames.push(hasGame);
319319
} else {
320-
context.errorMessage = `Team ${currentTeam.short_name} does not appear to have a game this week! If this is incorrect, please email Stephen to make your pick.`
320+
context.errorMessage = `Team ${currentTeam.short_name} does not appear to have a game during the selected week! If this is incorrect, please email commissioner to make your pick.`
321321
return false;
322322
}
323323
}
@@ -335,7 +335,7 @@ async function validatePickTwoPick(pickRequest, pg, context) {
335335
for (const game of pickedGames) {
336336
const gameDate = new Date(game.start_time);
337337
if (gameDate < now) {
338-
context.errorMessage = 'At least one selected game appears to have already started! If this is incorrect, please email Stephen to make your pick.'
338+
context.errorMessage = 'At least one selected game appears to have already started! If this is incorrect, please email commissioner to make your pick.'
339339
return false;
340340
}
341341
}
@@ -355,7 +355,7 @@ async function validatePickTwoPick(pickRequest, pg, context) {
355355
}
356356
} else {
357357
// At least one of these teams has already been picked by this player
358-
context.errorMessage = 'You have already picked at least one of these teams! If this is incorrect, please email Stephen to make your pick.'
358+
context.errorMessage = 'You have already picked at least one of these teams! If this is incorrect, please email commissioner to make your pick.'
359359
return false;
360360
}
361361
}
@@ -383,7 +383,7 @@ async function validatePickTwoPick(pickRequest, pg, context) {
383383
if (pickedGame) {
384384
const gameDate = new Date(pickedGame.start_time);
385385
if (gameDate < now) {
386-
context.errorMessage = 'At least one team from your PREVIOUS submission has already started their game. If this is incorrect, please email Stephen to make your pick.'
386+
context.errorMessage = 'At least one team from your PREVIOUS submission has already started their game. If this is incorrect, please email commissioner to make your pick.'
387387
return false;
388388
}
389389
}

seed_data/nfl_2025.csv

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
1,2025-09-04T20:20:00-05:00,DAL,PHI
2+
1,2025-09-05T20:00:00-05:00,KC,LAC
3+
1,2025-09-07T13:00:00-05:00,TB,ATL
4+
1,2025-09-07T13:00:00-05:00,CIN,CLE
5+
1,2025-09-07T13:00:00-05:00,MIA,IND
6+
1,2025-09-07T13:00:00-05:00,CAR,JAX
7+
1,2025-09-07T13:00:00-05:00,LV,NE
8+
1,2025-09-07T13:00:00-05:00,ARI,NO
9+
1,2025-09-07T13:00:00-05:00,PIT,NYJ
10+
1,2025-09-07T13:00:00-05:00,NYG,WAS
11+
1,2025-09-07T16:05:00-05:00,TEN,DEN
12+
1,2025-09-07T16:05:00-05:00,SF,SEA
13+
1,2025-09-07T16:25:00-05:00,DET,GB
14+
1,2025-09-07T16:25:00-05:00,HOU,LAR
15+
1,2025-09-07T20:20:00-05:00,BAL,BUF
16+
1,2025-09-08T20:15:00-05:00,MIN,CHI
17+
2,2025-09-11T20:15:00-05:00,WAS,GB
18+
2,2025-09-14T13:00:00-05:00,CLE,BAL
19+
2,2025-09-14T13:00:00-05:00,JAX,CIN
20+
2,2025-09-14T13:00:00-05:00,NYG,DAL
21+
2,2025-09-14T13:00:00-05:00,CHI,DET
22+
2,2025-09-14T13:00:00-05:00,NE,MIA
23+
2,2025-09-14T13:00:00-05:00,SF,NO
24+
2,2025-09-14T13:00:00-05:00,BUF,NYJ
25+
2,2025-09-14T13:00:00-05:00,SEA,PIT
26+
2,2025-09-14T13:00:00-05:00,LAR,TEN
27+
2,2025-09-14T16:05:00-05:00,CAR,ARI
28+
2,2025-09-14T16:05:00-05:00,DEN,IND
29+
2,2025-09-14T16:25:00-05:00,PHI,KC
30+
2,2025-09-14T20:20:00-05:00,ATL,MIN
31+
2,2025-09-15T19:00:00-05:00,TB,HOU
32+
2,2025-09-15T22:00:00-05:00,LAC,LV
33+
3,2025-09-18T20:15:00-05:00,MIA,BUF
34+
3,2025-09-21T13:00:00-05:00,ATL,CAR
35+
3,2025-09-21T13:00:00-05:00,GB,CLE
36+
3,2025-09-21T13:00:00-05:00,HOU,JAX
37+
3,2025-09-21T13:00:00-05:00,CIN,MIN
38+
3,2025-09-21T13:00:00-05:00,PIT,NE
39+
3,2025-09-21T13:00:00-05:00,LAR,PHI
40+
3,2025-09-21T13:00:00-05:00,NYJ,TB
41+
3,2025-09-21T13:00:00-05:00,IND,TEN
42+
3,2025-09-21T13:00:00-05:00,LV,WAS
43+
3,2025-09-21T16:05:00-05:00,DEN,LAC
44+
3,2025-09-21T16:05:00-05:00,NO,SEA
45+
3,2025-09-21T16:25:00-05:00,DAL,CHI
46+
3,2025-09-21T16:25:00-05:00,ARI,SF
47+
3,2025-09-21T20:20:00-05:00,KC,NYG
48+
3,2025-09-22T20:15:00-05:00,DET,BAL
49+
4,2025-09-25T20:15:00-05:00,SEA,ARI
50+
4,2025-09-28T09:30:00-05:00,MIN,PIT
51+
4,2025-09-28T13:00:00-05:00,WAS,ATL
52+
4,2025-09-28T13:00:00-05:00,NO,BUF
53+
4,2025-09-28T13:00:00-05:00,CLE,DET
54+
4,2025-09-28T13:00:00-05:00,TEN,HOU
55+
4,2025-09-28T13:00:00-05:00,CAR,NE
56+
4,2025-09-28T13:00:00-05:00,LAC,NYG
57+
4,2025-09-28T13:00:00-05:00,PHI,TB
58+
4,2025-09-28T16:05:00-05:00,IND,LAR
59+
4,2025-09-28T16:05:00-05:00,JAX,SF
60+
4,2025-09-28T16:25:00-05:00,BAL,KC
61+
4,2025-09-28T16:25:00-05:00,CHI,LV
62+
4,2025-09-28T20:20:00-05:00,GB,DAL
63+
4,2025-09-29T19:15:00-05:00,NYJ,MIA
64+
4,2025-09-29T20:15:00-05:00,CIN,DEN
65+
5,2025-10-02T20:15:00-05:00,SF,LAR
66+
5,2025-10-05T09:30:00-05:00,MIN,CLE
67+
5,2025-10-05T13:00:00-05:00,HOU,BAL
68+
5,2025-10-05T13:00:00-05:00,MIA,CAR
69+
5,2025-10-05T13:00:00-05:00,LV,IND
70+
5,2025-10-05T13:00:00-05:00,NYG,NO
71+
5,2025-10-05T13:00:00-05:00,DAL,NYJ
72+
5,2025-10-05T13:00:00-05:00,DEN,PHI
73+
5,2025-10-05T16:05:00-05:00,TEN,ARI
74+
5,2025-10-05T16:05:00-05:00,TB,SEA
75+
5,2025-10-05T16:25:00-05:00,DET,CIN
76+
5,2025-10-05T16:25:00-05:00,WAS,LAC
77+
5,2025-10-05T20:20:00-05:00,NE,BUF
78+
5,2025-10-06T20:15:00-05:00,KC,JAX
79+
6,2025-10-09T20:15:00-05:00,PHI,NYG
80+
6,2025-10-12T09:30:00-05:00,DEN,NYJ
81+
6,2025-10-12T13:00:00-05:00,LAR,BAL
82+
6,2025-10-12T13:00:00-05:00,DAL,CAR
83+
6,2025-10-12T13:00:00-05:00,ARI,IND
84+
6,2025-10-12T13:00:00-05:00,SEA,JAX
85+
6,2025-10-12T13:00:00-05:00,LAC,MIA
86+
6,2025-10-12T13:00:00-05:00,CLE,PIT
87+
6,2025-10-12T13:00:00-05:00,SF,TB
88+
6,2025-10-12T16:05:00-05:00,TEN,LV
89+
6,2025-10-12T16:25:00-05:00,CIN,GB
90+
6,2025-10-12T16:25:00-05:00,NE,NO
91+
6,2025-10-12T20:20:00-05:00,DET,KC
92+
6,2025-10-13T19:15:00-05:00,BUF,ATL
93+
6,2025-10-13T20:15:00-05:00,CHI,WAS
94+
7,2025-10-16T20:15:00-05:00,PIT,CIN
95+
7,2025-10-19T09:30:00-05:00,LAR,JAX
96+
7,2025-10-19T13:00:00-05:00,NO,CHI
97+
7,2025-10-19T13:00:00-05:00,MIA,CLE
98+
7,2025-10-19T13:00:00-05:00,LV,KC
99+
7,2025-10-19T13:00:00-05:00,PHI,MIN
100+
7,2025-10-19T13:00:00-05:00,CAR,NYJ
101+
7,2025-10-19T13:00:00-05:00,NE,TEN
102+
7,2025-10-19T16:05:00-05:00,NYG,DEN
103+
7,2025-10-19T16:05:00-05:00,IND,LAC
104+
7,2025-10-19T16:25:00-05:00,GB,ARI
105+
7,2025-10-19T16:25:00-05:00,WAS,DAL
106+
7,2025-10-19T20:20:00-05:00,ATL,SF
107+
7,2025-10-20T19:00:00-05:00,TB,DET
108+
7,2025-10-20T22:00:00-05:00,HOU,SEA
109+
8,2025-10-23T20:15:00-05:00,MIN,LAC
110+
8,2025-10-26T13:00:00-05:00,MIA,ATL
111+
8,2025-10-26T13:00:00-05:00,CHI,BAL
112+
8,2025-10-26T13:00:00-05:00,BUF,CAR
113+
8,2025-10-26T13:00:00-05:00,NYJ,CIN
114+
8,2025-10-26T13:00:00-05:00,SF,HOU
115+
8,2025-10-26T13:00:00-05:00,CLE,NE
116+
8,2025-10-26T13:00:00-05:00,NYG,PHI
117+
8,2025-10-26T16:05:00-05:00,TB,NO
118+
8,2025-10-26T16:25:00-05:00,DAL,DEN
119+
8,2025-10-26T16:25:00-05:00,TEN,IND
120+
8,2025-10-26T20:20:00-05:00,GB,PIT
121+
8,2025-10-27T20:15:00-05:00,WAS,KC
122+
9,2025-10-30T20:15:00-05:00,BAL,MIA
123+
9,2025-11-02T13:00:00-05:00,CHI,CIN
124+
9,2025-11-02T13:00:00-05:00,MIN,DET
125+
9,2025-11-02T13:00:00-05:00,CAR,GB
126+
9,2025-11-02T13:00:00-05:00,DEN,HOU
127+
9,2025-11-02T13:00:00-05:00,ATL,NE
128+
9,2025-11-02T13:00:00-05:00,SF,NYG
129+
9,2025-11-02T13:00:00-05:00,IND,PIT
130+
9,2025-11-02T13:00:00-05:00,LAC,TEN
131+
9,2025-11-02T16:05:00-05:00,NO,LAR
132+
9,2025-11-02T16:05:00-05:00,JAX,LV
133+
9,2025-11-02T16:25:00-05:00,KC,BUF
134+
9,2025-11-02T20:20:00-05:00,SEA,WAS
135+
9,2025-11-03T20:15:00-05:00,ARI,DAL
136+
10,2025-11-06T20:15:00-05:00,LV,DEN
137+
10,2025-11-09T09:30:00-05:00,ATL,IND
138+
10,2025-11-09T13:00:00-05:00,NO,CAR
139+
10,2025-11-09T13:00:00-05:00,NYG,CHI
140+
10,2025-11-09T13:00:00-05:00,JAX,HOU
141+
10,2025-11-09T13:00:00-05:00,BUF,MIA
142+
10,2025-11-09T13:00:00-05:00,BAL,MIN
143+
10,2025-11-09T13:00:00-05:00,CLE,NYJ
144+
10,2025-11-09T13:00:00-05:00,NE,TB
145+
10,2025-11-09T16:05:00-05:00,ARI,SEA
146+
10,2025-11-09T16:25:00-05:00,LAR,SF
147+
10,2025-11-09T16:25:00-05:00,DET,WAS
148+
10,2025-11-09T20:20:00-05:00,PIT,LAC
149+
10,2025-11-10T20:15:00-05:00,PHI,GB
150+
11,2025-11-13T20:15:00-05:00,NYJ,NE
151+
11,2025-11-16T09:30:00-05:00,WAS,MIA
152+
11,2025-11-16T13:00:00-05:00,CAR,ATL
153+
11,2025-11-16T13:00:00-05:00,TB,BUF
154+
11,2025-11-16T13:00:00-05:00,LAC,JAX
155+
11,2025-11-16T13:00:00-05:00,CHI,MIN
156+
11,2025-11-16T13:00:00-05:00,GB,NYG
157+
11,2025-11-16T13:00:00-05:00,CIN,PIT
158+
11,2025-11-16T13:00:00-05:00,HOU,TEN
159+
11,2025-11-16T16:05:00-05:00,SF,ARI
160+
11,2025-11-16T16:05:00-05:00,SEA,LAR
161+
11,2025-11-16T16:25:00-05:00,BAL,CLE
162+
11,2025-11-16T16:25:00-05:00,KC,DEN
163+
11,2025-11-16T20:20:00-05:00,DET,PHI
164+
11,2025-11-17T20:15:00-05:00,DAL,LV
165+
12,2025-11-20T20:15:00-05:00,BUF,HOU
166+
12,2025-11-23T13:00:00-05:00,NYJ,BAL
167+
12,2025-11-23T13:00:00-05:00,PIT,CHI
168+
12,2025-11-23T13:00:00-05:00,NE,CIN
169+
12,2025-11-23T13:00:00-05:00,NYG,DET
170+
12,2025-11-23T13:00:00-05:00,MIN,GB
171+
12,2025-11-23T13:00:00-05:00,IND,KC
172+
12,2025-11-23T13:00:00-05:00,SEA,TEN
173+
12,2025-11-23T16:05:00-05:00,JAX,ARI
174+
12,2025-11-23T16:05:00-05:00,CLE,LV
175+
12,2025-11-23T16:25:00-05:00,PHI,DAL
176+
12,2025-11-23T16:25:00-05:00,ATL,NO
177+
12,2025-11-23T20:20:00-05:00,TB,LAR
178+
12,2025-11-24T20:15:00-05:00,CAR,SF
179+
13,2025-11-27T13:00:00-05:00,GB,DET
180+
13,2025-11-27T16:30:00-05:00,KC,DAL
181+
13,2025-11-27T20:20:00-05:00,CIN,BAL
182+
13,2025-11-28T15:00:00-05:00,CHI,PHI
183+
13,2025-11-30T13:00:00-05:00,LAR,CAR
184+
13,2025-11-30T13:00:00-05:00,SF,CLE
185+
13,2025-11-30T13:00:00-05:00,HOU,IND
186+
13,2025-11-30T13:00:00-05:00,NO,MIA
187+
13,2025-11-30T13:00:00-05:00,ATL,NYJ
188+
13,2025-11-30T13:00:00-05:00,ARI,TB
189+
13,2025-11-30T13:00:00-05:00,JAX,TEN
190+
13,2025-11-30T16:05:00-05:00,MIN,SEA
191+
13,2025-11-30T16:25:00-05:00,LV,LAC
192+
13,2025-11-30T16:25:00-05:00,BUF,PIT
193+
13,2025-11-30T20:20:00-05:00,DEN,WAS
194+
13,2025-12-01T20:15:00-05:00,NYG,NE
195+
14,2025-12-04T20:15:00-05:00,DAL,DET
196+
14,2025-12-07T13:00:00-05:00,SEA,ATL
197+
14,2025-12-07T13:00:00-05:00,PIT,BAL
198+
14,2025-12-07T13:00:00-05:00,TEN,CLE
199+
14,2025-12-07T13:00:00-05:00,CHI,GB
200+
14,2025-12-07T13:00:00-05:00,IND,JAX
201+
14,2025-12-07T13:00:00-05:00,WAS,MIN
202+
14,2025-12-07T13:00:00-05:00,MIA,NYJ
203+
14,2025-12-07T13:00:00-05:00,NO,TB
204+
14,2025-12-07T16:05:00-05:00,DEN,LV
205+
14,2025-12-07T16:25:00-05:00,LAR,ARI
206+
14,2025-12-07T16:25:00-05:00,CIN,BUF
207+
14,2025-12-07T20:20:00-05:00,HOU,KC
208+
14,2025-12-08T20:15:00-05:00,PHI,LAC
209+
15,2025-12-11T20:15:00-05:00,ATL,TB
210+
15,2025-12-14T13:00:00-05:00,CLE,CHI
211+
15,2025-12-14T13:00:00-05:00,BAL,CIN
212+
15,2025-12-14T13:00:00-05:00,ARI,HOU
213+
15,2025-12-14T13:00:00-05:00,NYJ,JAX
214+
15,2025-12-14T13:00:00-05:00,LAC,KC
215+
15,2025-12-14T13:00:00-05:00,BUF,NE
216+
15,2025-12-14T13:00:00-05:00,WAS,NYG
217+
15,2025-12-14T13:00:00-05:00,LV,PHI
218+
15,2025-12-14T16:25:00-05:00,GB,DEN
219+
15,2025-12-14T16:25:00-05:00,DET,LAR
220+
15,2025-12-14T16:25:00-05:00,CAR,NO
221+
15,2025-12-14T16:25:00-05:00,IND,SEA
222+
15,2025-12-14T16:25:00-05:00,TEN,SF
223+
15,2025-12-14T20:20:00-05:00,MIN,DAL
224+
15,2025-12-15T20:15:00-05:00,MIA,PIT
225+
16,2025-12-18T20:15:00-05:00,LAR,SEA
226+
16,2025-12-20T20:15:00-05:00,GB,CHI
227+
16,2025-12-20T20:15:00-05:00,PHI,WAS
228+
16,2025-12-21T13:00:00-05:00,NE,BAL
229+
16,2025-12-21T13:00:00-05:00,TB,CAR
230+
16,2025-12-21T13:00:00-05:00,BUF,CLE
231+
16,2025-12-21T13:00:00-05:00,LAC,DAL
232+
16,2025-12-21T13:00:00-05:00,NYJ,NO
233+
16,2025-12-21T13:00:00-05:00,MIN,NYG
234+
16,2025-12-21T13:00:00-05:00,KC,TEN
235+
16,2025-12-21T16:05:00-05:00,ATL,ARI
236+
16,2025-12-21T16:05:00-05:00,JAX,DEN
237+
16,2025-12-21T16:25:00-05:00,PIT,DET
238+
16,2025-12-21T16:25:00-05:00,LV,HOU
239+
16,2025-12-21T20:20:00-05:00,CIN,MIA
240+
16,2025-12-22T20:15:00-05:00,SF,IND
241+
17,2025-12-25T13:00:00-05:00,DAL,WAS
242+
17,2025-12-25T16:30:00-05:00,DET,MIN
243+
17,2025-12-25T20:15:00-05:00,DEN,KC
244+
17,2025-12-27T20:15:00-05:00,SEA,CAR
245+
17,2025-12-27T20:15:00-05:00,ARI,CIN
246+
17,2025-12-27T20:15:00-05:00,BAL,GB
247+
17,2025-12-27T20:15:00-05:00,HOU,LAC
248+
17,2025-12-27T20:15:00-05:00,NYG,LV
249+
17,2025-12-28T13:00:00-05:00,PIT,CLE
250+
17,2025-12-28T13:00:00-05:00,JAX,IND
251+
17,2025-12-28T13:00:00-05:00,TB,MIA
252+
17,2025-12-28T13:00:00-05:00,NE,NYJ
253+
17,2025-12-28T13:00:00-05:00,NO,TEN
254+
17,2025-12-28T16:25:00-05:00,PHI,BUF
255+
17,2025-12-28T20:20:00-05:00,CHI,SF
256+
17,2025-12-29T20:15:00-05:00,LAR,ATL
257+
18,2026-01-03T13:00:00-05:00,NO,ATL
258+
18,2026-01-03T13:00:00-05:00,NYJ,BUF
259+
18,2026-01-03T13:00:00-05:00,DET,CHI
260+
18,2026-01-03T13:00:00-05:00,CLE,CIN
261+
18,2026-01-03T13:00:00-05:00,LAC,DEN
262+
18,2026-01-03T13:00:00-05:00,IND,HOU
263+
18,2026-01-03T13:00:00-05:00,TEN,JAX
264+
18,2026-01-03T13:00:00-05:00,ARI,LAR
265+
18,2026-01-03T13:00:00-05:00,KC,LV
266+
18,2026-01-03T13:00:00-05:00,GB,MIN
267+
18,2026-01-03T13:00:00-05:00,MIA,NE
268+
18,2026-01-03T13:00:00-05:00,DAL,NYG
269+
18,2026-01-03T13:00:00-05:00,WAS,PHI
270+
18,2026-01-03T13:00:00-05:00,BAL,PIT
271+
18,2026-01-03T13:00:00-05:00,SEA,SF
272+
18,2026-01-03T13:00:00-05:00,CAR,TB

0 commit comments

Comments
 (0)