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

Wipe everything script fails due to foreign key constraints #1195

Closed
trichoplax opened this issue Aug 24, 2023 · 4 comments
Closed

Wipe everything script fails due to foreign key constraints #1195

trichoplax opened this issue Aug 24, 2023 · 4 comments
Labels
area: deployment Issues in setting up qpixel, containers, etc. type: bug Something isn't working

Comments

@trichoplax
Copy link
Contributor

Describe the bug
Running the script with rails runner gives an error, and the deletion of the database data fails:

$ rails r scripts/wipe_everything.rb

Mysql2::Error: Cannot delete or update a parent row: a foreign key constraint fails (qpixel_dev.user_abilities, CONSTRAINT fk_rails_de15a6ad96 FOREIGN KEY (ability_id) REFERENCES abilities (id)) (ActiveRecord::InvalidForeignKey)

To Reproduce
Steps to reproduce the behavior:

  • No preparation required - simply run the script from the terminal as described.

Expected behavior
The database should be emptied and reseeded as if starting from a new installation.

A decision needs to be made to either fix this script (which may involve deleting the data per table in a specific order) or to delete this script if it is no longer required.

@cellio cellio added type: bug Something isn't working area: deployment Issues in setting up qpixel, containers, etc. labels Aug 24, 2023
@cellio
Copy link
Member

cellio commented Oct 3, 2023

Does that PR fully address this? I.e. should we close this issue now, or is there something still to do?

@TimothyDLewis
Copy link
Contributor

Fully addresses it; so yes, this can be closed now 🙂 (Sorry, used to issues auto-closing when an associated PR is merged and closed; didn't realize this was a manual process at the moment)

@cellio
Copy link
Member

cellio commented Oct 3, 2023

Usually it does auto-close; I don't know why it didn't here. Fixing that now.

@cellio cellio closed this as completed Oct 3, 2023
@TimothyDLewis
Copy link
Contributor

Oh hmm... Chances are I didn't link it correctly; I'll double-check that next time 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: deployment Issues in setting up qpixel, containers, etc. type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants