From d07dd3b8e98246a8767800cd13ddb338ece9c8b8 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Mon, 10 Jun 2024 13:28:57 -0400 Subject: [PATCH] Delete api session certs when related api session are deleted. Fixes #2124 --- controller/db/api_session_certificate_store.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controller/db/api_session_certificate_store.go b/controller/db/api_session_certificate_store.go index 2762a8e4b..8945d3f9a 100644 --- a/controller/db/api_session_certificate_store.go +++ b/controller/db/api_session_certificate_store.go @@ -68,11 +68,11 @@ func (store *ApiSessionCertificateStoreImpl) initializeLocal() { store.AddSymbol(FieldApiSessionCertificateApiSession, ast.NodeTypeString) store.AddSymbol(FieldApiSessionCertificateSubject, ast.NodeTypeString) store.AddSymbol(FieldApiSessionCertificateFingerprint, ast.NodeTypeString) - store.symbolApiSession = store.AddFkSymbol(FieldApiSessionCertificateApiSession, store.stores.apiSession) + store.symbolApiSession = store.AddSymbol(FieldApiSessionCertificateApiSession, ast.NodeTypeString) } func (store *ApiSessionCertificateStoreImpl) initializeLinked() { - store.AddFkIndex(store.symbolApiSession, store.stores.apiSession.apiSessionCertsSymbol) + store.AddFkIndexCascadeDelete(store.symbolApiSession, store.stores.apiSession.apiSessionCertsSymbol) } func (store *ApiSessionCertificateStoreImpl) NewEntity() *ApiSessionCertificate {