[management] add gorm tag for primary key for the networks objects (#3758)

This commit is contained in:
Pascal Fischer
2025-05-04 20:58:04 +02:00
committed by GitHub
parent 12f883badf
commit 055df9854c
9 changed files with 63 additions and 7 deletions

View File

@ -82,6 +82,10 @@ func NewSqlStore(ctx context.Context, db *gorm.DB, storeEngine types.Engine, met
log.WithContext(ctx).Warnf("setting NB_SQL_MAX_OPEN_CONNS is not supported for sqlite, using default value 1")
}
conns = 1
_, err = sql.Exec("PRAGMA foreign_keys = ON")
if err != nil {
return nil, fmt.Errorf("failed to set foreign keys for sqlite: %w", err)
}
}
sql.SetMaxOpenConns(conns)