diff --git a/pkg/coredata/migrations/20260304T151104Z.sql b/pkg/coredata/migrations/20260304T151104Z.sql index 49f0e17b7..bae57e5d4 100644 --- a/pkg/coredata/migrations/20260304T151104Z.sql +++ b/pkg/coredata/migrations/20260304T151104Z.sql @@ -62,7 +62,15 @@ ALTER TABLE ALTER COLUMN identity_id SET - NOT NULL; + NOT NULL, +ALTER COLUMN + email DROP NOT NULL, +ALTER COLUMN + name DROP NOT NULL, +ALTER COLUMN + state DROP NOT NULL, +ALTER COLUMN + has_accepted_non_disclosure_agreement DROP NOT NULL; CREATE UNIQUE INDEX idx_trust_center_accesses_identity_id_organization_id ON trust_center_accesses(identity_id, organization_id); diff --git a/pkg/coredata/trust_center_access.go b/pkg/coredata/trust_center_access.go index 785acc5f3..87406f853 100644 --- a/pkg/coredata/trust_center_access.go +++ b/pkg/coredata/trust_center_access.go @@ -78,6 +78,7 @@ SELECT id, organization_id, tenant_id, + identity_id, trust_center_id, nda_file_id, electronic_signature_id, @@ -127,6 +128,7 @@ SELECT id, organization_id, tenant_id, + identity_id, trust_center_id, nda_file_id, electronic_signature_id, @@ -178,6 +180,7 @@ INSERT INTO trust_center_accesses ( id, tenant_id, organization_id, + identity_id, trust_center_id, electronic_signature_id, created_at, @@ -186,6 +189,7 @@ INSERT INTO trust_center_accesses ( @id, @tenant_id, @organization_id, + @identity_id, @trust_center_id, @electronic_signature_id, @created_at, @@ -197,6 +201,7 @@ INSERT INTO trust_center_accesses ( "id": tca.ID, "tenant_id": tca.TenantID, "organization_id": tca.OrganizationID, + "identity_id": tca.IdentityID, "trust_center_id": tca.TrustCenterID, "electronic_signature_id": tca.ElectronicSignatureID, "created_at": tca.CreatedAt, @@ -289,6 +294,7 @@ SELECT id, organization_id, tenant_id, + identity_id, trust_center_id, nda_file_id, electronic_signature_id, diff --git a/pkg/probo/trust_center_access_service.go b/pkg/probo/trust_center_access_service.go index adf847d5d..2072f9ea0 100644 --- a/pkg/probo/trust_center_access_service.go +++ b/pkg/probo/trust_center_access_service.go @@ -246,6 +246,7 @@ func (s TrustCenterAccessService) Create( ID: gid.New(s.svc.scope.GetTenantID(), coredata.TrustCenterAccessEntityType), OrganizationID: trustCenter.OrganizationID, TenantID: s.svc.scope.GetTenantID(), + IdentityID: profile.IdentityID, TrustCenterID: req.TrustCenterID, CreatedAt: now, UpdatedAt: now, diff --git a/pkg/trust/trust_center_access_service.go b/pkg/trust/trust_center_access_service.go index fe0bc465a..18f840e2a 100644 --- a/pkg/trust/trust_center_access_service.go +++ b/pkg/trust/trust_center_access_service.go @@ -82,6 +82,7 @@ func (s TrustCenterAccessService) ensureAccessInTx( ID: gid.New(s.svc.scope.GetTenantID(), coredata.TrustCenterAccessEntityType), OrganizationID: trustCenter.OrganizationID, TenantID: s.svc.scope.GetTenantID(), + IdentityID: identityID, TrustCenterID: trustCenterID, CreatedAt: now, UpdatedAt: now,