Skip to content

Commit

Permalink
changed lap primary key to be composite
Browse files Browse the repository at this point in the history
  • Loading branch information
BK1031 committed Jun 12, 2024
1 parent ba29428 commit 79af0da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vehicle.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type Lap struct {
ID string `json:"id" gorm:"primaryKey"`

// The TripID is the unique identifier for the trip that the lap is associated with.
TripID string `json:"trip_id"`
TripID string `json:"trip_id" gorm:primaryKey"`

// The Name is the public-facing name of the lap.
Name string `json:"name"`
Expand All @@ -71,5 +71,5 @@ type Lap struct {
}

func (Lap) TableName() string {
return "lap"
return "trip_lap"
}

0 comments on commit 79af0da

Please sign in to comment.