Skip to content

Commit

Permalink
Add geoname indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmmbaga committed Feb 5, 2024
1 parent b9bdfa9 commit 1bd4644
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions management/server/geolocation/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,16 @@ func setupInMemoryDBFromFile(db *gorm.DB, source string) error {
return err
}

// index geoname_id and country_iso_code field
err = db.Exec("CREATE INDEX idx_geonames_country_iso_code ON geonames(country_iso_code);").Error
if err != nil {
log.Fatal(err)
}

err = db.Exec("CREATE INDEX idx_geonames_geoname_id ON geonames(geoname_id);").Error
if err != nil {
log.Fatal(err)
}

return nil
}

0 comments on commit 1bd4644

Please sign in to comment.