fix: use trap dictionary gorm column names
This commit is contained in:
@@ -231,7 +231,7 @@ func seedDefaultTrapDictionary(db *gorm.DB) error {
|
||||
}
|
||||
for _, row := range rows {
|
||||
var existing TrapDictionaryEntry
|
||||
err := db.Where("oid_prefix = ?", row.OIDPrefix).First(&existing).Error
|
||||
err := db.Where("o_id_prefix = ?", row.OIDPrefix).First(&existing).Error
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
if err := db.Create(&row).Error; err != nil {
|
||||
return err
|
||||
@@ -242,7 +242,7 @@ func seedDefaultTrapDictionary(db *gorm.DB) error {
|
||||
return err
|
||||
}
|
||||
if err := db.Model(&existing).Omit("updated_at").Select(
|
||||
"oid_prefix",
|
||||
"o_id_prefix",
|
||||
"vendor",
|
||||
"o_id",
|
||||
"name",
|
||||
|
||||
Reference in New Issue
Block a user