Skip to content

VCST-3962: Delete orphaned entities#466

Merged
OlegoO merged 2 commits intodevfrom
fix/VCST-3962
Sep 26, 2025
Merged

VCST-3962: Delete orphaned entities#466
OlegoO merged 2 commits intodevfrom
fix/VCST-3962

Conversation

@OlegoO
Copy link
Contributor

@OlegoO OlegoO commented Sep 23, 2025

Description

fix: Mark orphaned Order Entity records that no longer have a parent as Deleted. It resolves breaking changes in EF Core 7.0 (EF7) when EF Core will not automatically delete orphans when all FKs are nullable. https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes?tabs=v7#orphaned-dependents-of-optional-relationships-are-not-automatically-deleted

Note: To remove old not automatically delete orphans, please run the following SQL queries manually:

DELETE FROM OrderCapture WHERE PaymentId IS NULL
DELETE FROM OrderRefund WHERE PaymentId IS NULL

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-3962

Artifact URL:

https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Orders_3.858.0-pr-466-bf09.zip

fix: Mark orphaned Catalog Entity records that no longer have a parent as Deleted. It resolves breaking changes in EF Core 7.0 (EF7) when EF Core will not automatically delete orphans when all FKs are nullable. https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes?tabs=v7#orphaned-dependents-of-optional-relationships-are-not-automatically-deleted
cursor[bot]

This comment was marked as outdated.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 23, 2025

Copy link
Contributor

@vc-ci vc-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Suite: Test Suites/Modules/module_Assets
Tests: 13
Failures: 0
Errors: 0
Time: 7.754
Timestamp: 23-09-2025T10:21:00

@OlegoO OlegoO merged commit e372e22 into dev Sep 26, 2025
2 of 3 checks passed
@OlegoO OlegoO deleted the fix/VCST-3962 branch September 26, 2025 14:03
OlegoO added a commit that referenced this pull request Sep 26, 2025
OlegoO added a commit that referenced this pull request Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants