This commit is contained in:
bcmmbaga
2024-04-30 10:07:40 +03:00
parent 90ebf0017b
commit 7aff0e828b

View File

@@ -103,7 +103,6 @@ func MigrateFieldFromGobToJSON[T any, S any](db *gorm.DB, fieldName string) erro
// MigrateNetIPFieldFromBlobToJSON migrates a Net IP column from Blob encoding to JSON encoding.
// T is the type of the model that contains the field to be migrated.
// S is the type of the field to be migrated.
func MigrateNetIPFieldFromBlobToJSON[T any](db *gorm.DB, fieldName string, indexName string) error {
oldColumnName := fieldName
newColumnName := fieldName + "_tmp"
@@ -130,9 +129,6 @@ func MigrateNetIPFieldFromBlobToJSON[T any](db *gorm.DB, fieldName string, index
}
return fmt.Errorf("fetch first record: %w", err)
}
if len(item) < 0 {
return fmt.Errorf("no records fetched")
}
var js json.RawMessage
var syntaxError *json.SyntaxError