Skip to content

Commit

Permalink
add uuid to db methods
Browse files Browse the repository at this point in the history
  • Loading branch information
argonaut0 committed Sep 15, 2023
1 parent d936a41 commit c329bff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func (in *Instancer) ReadInstanceRecords() ([]InstanceRecord, error) {
if in.db == nil {
return nil, errors.New("db not initialized")
}
rows, err := in.db.Query("SELECT id, challenge, team, expiry FROM instances")
rows, err := in.db.Query("SELECT id, challenge, team, expiry, uuid FROM instances")
if err != nil {
return nil, err
}
Expand All @@ -101,7 +101,7 @@ func (in *Instancer) ReadInstanceRecords() ([]InstanceRecord, error) {
for rows.Next() {
record := InstanceRecord{}
var t int64
err = rows.Scan(&record.Id, &record.Challenge, &record.TeamID, &t)
err = rows.Scan(&record.Id, &record.Challenge, &record.TeamID, &t, &record.UUID)
if err != nil {
return records, err
}
Expand All @@ -116,7 +116,7 @@ func (in *Instancer) ReadInstanceRecordsTeam(teamID string) ([]InstanceRecord, e
if in.db == nil {
return nil, errors.New("db not initialized")
}
stmt, err := in.db.Prepare("SELECT id, challenge, team, expiry FROM instances WHERE team = ?")
stmt, err := in.db.Prepare("SELECT id, challenge, team, expiry, uuid FROM instances WHERE team = ?")
if err != nil {
return nil, err
}
Expand All @@ -131,7 +131,7 @@ func (in *Instancer) ReadInstanceRecordsTeam(teamID string) ([]InstanceRecord, e
for rows.Next() {
record := InstanceRecord{}
var t int64
err = rows.Scan(&record.Id, &record.Challenge, &record.TeamID, &t)
err = rows.Scan(&record.Id, &record.Challenge, &record.TeamID, &t, &record.UUID)
if err != nil {
return records, err
}
Expand Down

0 comments on commit c329bff

Please sign in to comment.