added login with pages and database, also correct errors in score submit
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
event_type,division,event_state,winner,time_completed
|
||||
100m Sprint,Year 7,0,,
|
||||
100m Sprint,Year 8,0,,
|
||||
100m Sprint,Year 9,2,East,
|
||||
100m Sprint,Year 10,1,,
|
||||
100m Sprint,Year 9,0,,
|
||||
100m Sprint,Year 10,0,,
|
||||
200m Sprint,Year 7,0,,
|
||||
200m Sprint,Year 8,0,,
|
||||
200m Sprint,Year 9,0,,
|
||||
|
||||
|
@@ -59,11 +59,11 @@ Dante Sorensen,1000m Long Distance,0,C
|
||||
Mia Nguyen,1000m Long Distance,0,C
|
||||
Oluseun Alade,1000m Long Distance,0,C
|
||||
Tobias Crane,1000m Long Distance,0,C
|
||||
Alaric Olawale,100m Sprint,1,A
|
||||
Ava Mackenzie,100m Sprint,2,A
|
||||
Bjorn Oyelaran,100m Sprint,3,A
|
||||
Jack Simmons,100m Sprint,4,A
|
||||
Kai Johansson,100m Sprint,5,A
|
||||
Alaric Olawale,100m Sprint,0,A
|
||||
Ava Mackenzie,100m Sprint,0,A
|
||||
Bjorn Oyelaran,100m Sprint,0,A
|
||||
Jack Simmons,100m Sprint,0,A
|
||||
Kai Johansson,100m Sprint,0,A
|
||||
Clark Kent,100m Sprint,0,B
|
||||
Cormac Halvorsen,100m Sprint,0,B
|
||||
Marcus Okafor,100m Sprint,0,B
|
||||
|
||||
|
@@ -1,7 +1,9 @@
|
||||
preset,placement,points
|
||||
1,1,10
|
||||
1,2,7
|
||||
1,3,5
|
||||
1,1,5
|
||||
1,2,4
|
||||
1,3,3
|
||||
1,4,2
|
||||
1,5,1
|
||||
2,1,50
|
||||
2,2,30
|
||||
2,3,10
|
||||
|
||||
|
@@ -43,11 +43,18 @@ async function seed() {
|
||||
await db.delete(schema.players);
|
||||
await db.delete(schema.divisions);
|
||||
await db.delete(schema.teams);
|
||||
await db.delete(schema.scorers);
|
||||
await db.delete(schema.sessions);
|
||||
|
||||
await client.execute('DELETE FROM sqlite_sequence');
|
||||
|
||||
console.log('Database reset complete. Seeding...');
|
||||
|
||||
let passwordHash = await Bun.password.hash('password');
|
||||
await db
|
||||
.insert(schema.scorers)
|
||||
.values({ id: crypto.randomUUID(), username: 'admin', passwordHash: passwordHash });
|
||||
|
||||
// --- 1. Teams ---
|
||||
const teamsCSV = readCSV('teams.csv');
|
||||
for (const row of teamsCSV) {
|
||||
|
||||
Reference in New Issue
Block a user