Skip to content
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

Removing currency throws error #1780

Open
morawcik opened this issue May 26, 2024 · 1 comment
Open

Removing currency throws error #1780

morawcik opened this issue May 26, 2024 · 1 comment
Labels
1.x bug Something isn't working core Improvements or additions to core package

Comments

@morawcik
Copy link

  • Lunar version: 1.x
  • Laravel Version: 11.x
  • PHP Version: 8.2

When I'm trying to delete one currency (I have 3 right now) I'm getting this:

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`myperfectday`.`lunar_prices`, CONSTRAINT `lunar_prices_currency_id_foreign` FOREIGN KEY (`currency_id`) REFERENCES `lunar_currencies` (`id`))

delete from `lunar_currencies` where `id` = 3

I would expect that it will remove prices for this currency or in the "lazy version" just got message that this is not allowed.

@morawcik morawcik added bug Something isn't working unconfirmed labels May 26, 2024
@glennjacobs glennjacobs added the 1.x label May 28, 2024 — with Linear
@glennjacobs glennjacobs added the core Improvements or additions to core package label May 28, 2024 — with Linear
@alecritson
Copy link
Collaborator

PR #1859 introduces soft deleting to models, currencies included. Which should hopefully solve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x bug Something isn't working core Improvements or additions to core package
Projects
None yet
Development

No branches or pull requests

3 participants