[management] removal of foreign key constraint enforcement on sqlite (#3786)

This commit is contained in:
Pascal Fischer 2025-05-05 18:21:48 +02:00 committed by GitHub
parent 59faaa99f6
commit 25faf9283d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,10 +82,6 @@ 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") log.WithContext(ctx).Warnf("setting NB_SQL_MAX_OPEN_CONNS is not supported for sqlite, using default value 1")
} }
conns = 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) sql.SetMaxOpenConns(conns)