Merge branch 'feature/net-266-groups-migration' into feature/net-297-network-migration

This commit is contained in:
Pascal Fischer
2025-07-04 14:18:18 +02:00

View File

@@ -16,6 +16,7 @@ import (
log "github.com/sirupsen/logrus"
"gorm.io/gorm"
"gorm.io/gorm/clause"
)
type LegacyAccountNetwork struct {
@@ -467,7 +468,9 @@ func MigrateJsonToTable[T any](ctx context.Context, db *gorm.DB, columnName stri
}
for _, value := range data {
if err := tx.Create(
if err := tx.Clauses(clause.OnConflict{
DoNothing: true, // this needs to be removed when the cleanup is enabled
}).Create(
mapperFunc(row["id"].(string), value),
).Error; err != nil {
return fmt.Errorf("failed to insert id %v: %w", row["id"], err)