Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
svera committed Nov 3, 2023
1 parent 214120e commit bc315c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/infrastructure/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Connect(path string, wordsPerMinute float64) *gorm.DB {
log.Printf("Created database at %s\n", path)
}

// Use the following line to connect whe
// Use the following line to connect when the temporary code block below is removed
//db, err := gorm.Open(sqlite.Open(fmt.Sprintf("%s?_pragma=foreign_keys(1)", path)), &gorm.Config{})
db, err := gorm.Open(sqlite.Open(path), &gorm.Config{})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type User struct {
WordsPerMinute float64
RecoveryUUID string
RecoveryValidUntil time.Time
Highlights []Highlight `gorm:"constraint:OnDelete:CASCADE;"`
Highlights []Highlight `gorm:"constraint:OnDelete:CASCADE"`
}

// Validate checks all user's fields to ensure they are in the required format
Expand Down

0 comments on commit bc315c4

Please sign in to comment.