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 {
|
for _, row := range rows {
|
||||||
var existing TrapDictionaryEntry
|
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 errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
if err := db.Create(&row).Error; err != nil {
|
if err := db.Create(&row).Error; err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -242,7 +242,7 @@ func seedDefaultTrapDictionary(db *gorm.DB) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := db.Model(&existing).Omit("updated_at").Select(
|
if err := db.Model(&existing).Omit("updated_at").Select(
|
||||||
"oid_prefix",
|
"o_id_prefix",
|
||||||
"vendor",
|
"vendor",
|
||||||
"o_id",
|
"o_id",
|
||||||
"name",
|
"name",
|
||||||
|
|||||||
Reference in New Issue
Block a user