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

** (Ecto.ConstraintError) constraint error when attempting to delete struct: #102

Closed
1 task done
nelsonic opened this issue Sep 8, 2020 · 2 comments
Closed
1 task done
Labels
chore a tedious but necessary task often paying technical debt T25m Time Estimate 25 Minutes technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

nelsonic commented Sep 8, 2020

As part of Automatically Creating a New API Key during App creation #97
we are creating a foreign key constraint between API Keys and Apps.
Which means we get the following error when we attempt to Delete an App:

  1) test delete app deletes chosen app (AuthWeb.AppControllerTest)
     test/auth_web/controllers/app_controller_test.exs:82
     ** (Ecto.ConstraintError) constraint error when attempting to delete struct:

         * apikeys_app_id_fkey (foreign_key_constraint)

     If you would like to stop this constraint violation from raising an
     exception and instead add it as an error to your changeset, please
     call `foreign_key_constraint/3` on your changeset with the constraint
     `:name` as an option.

     The changeset has not defined any constraint.

Todo

  • Fix it!
@nelsonic nelsonic added chore a tedious but necessary task often paying technical debt T25m Time Estimate 25 Minutes technical A technical issue that requires understanding of the code, infrastructure or dependencies labels Sep 8, 2020
@nelsonic
Copy link
Member Author

nelsonic commented Sep 8, 2020

I'm going to define the deleted status in #101 and then use it in App.delete_app/1. #BRB

nelsonic added a commit that referenced this issue Sep 8, 2020
@nelsonic
Copy link
Member Author

nelsonic commented Sep 8, 2020

Fixed. ✅ (but not with out a lot of head-scratching ...) 🙄

@nelsonic nelsonic closed this as completed Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a tedious but necessary task often paying technical debt T25m Time Estimate 25 Minutes technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
None yet
Development

No branches or pull requests

1 participant