-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dependent: :destroy
to Spree::Order#order_promotions
#5411
Add dependent: :destroy
to Spree::Order#order_promotions
#5411
Conversation
869ecd2
to
885a62d
Compare
Codecov Report
@@ Coverage Diff @@
## main #5411 +/- ##
=======================================
Coverage 88.96% 88.96%
=======================================
Files 617 617
Lines 14876 14876
=======================================
Hits 13235 13235
Misses 1641 1641
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This is the same change as in solidusio/solidus#5411
Should I provide a migration to clear out orphaned records and add a foreign key constraint as well? |
We found a lot of orphaned records in our database due to this missing dependent: :destroy.
885a62d
to
b202ce7
Compare
Rebased, added foreign key constraint. |
@mamhoff can we ask for a
? thanks |
This adds a foreign key constraint that makes sure at the database level that we don't have non-existent order IDs in the spree_orders_promotions table.
b202ce7
to
9e4a2c9
Compare
Done |
dependent: :destroy
to Spree::Order#order_promotions
This is the same change as in solidusio/solidus#5411
This is the same change as in solidusio#5411
This is the same change as in solidusio/solidus#5411
This is the same change as in solidusio#5411
This is the same change as in solidusio#5411
This is the same change as in solidusio#5411
This is the same change as in solidusio#5411
This is the same change as in solidusio#5411
Summary
We found a lot of orphaned records in our database due to this missing dependent: :destroy.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: