You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the pgsql work, I am really looking at a lot of the database interactions. I noticed today that all of the removeFromRecipe methods simply delete the link in the *_in_recipe table. We make a copy of every ingredient when it gets added to a recipe, this leaves a lot of orphaned copies.
With some google and stack exchange, I was able to craft this query:
select h.id,h.name,h.deleted from hop h left outer join hop_in_recipe hir on ( h.id = hir.hop_id) where hir.id is null and h.display=false;
If I understand this correctly, it says find every row in the hop table that does not have a corresponding row in the hop_in_recipe table. I get about 70 or so responses. I get similar counts for fermentables and fewer for the other tables.
We need to be marking the copies as deleted, at least. I actually think we need to really delete them, since the copy cannot be accessed once it's removed from a recipe. We also probably should write something that will clean all of this up as part of an upgrade process.
The text was updated successfully, but these errors were encountered:
Based on the pgsql work, I am really looking at a lot of the database interactions. I noticed today that all of the removeFromRecipe methods simply delete the link in the *_in_recipe table. We make a copy of every ingredient when it gets added to a recipe, this leaves a lot of orphaned copies.
With some google and stack exchange, I was able to craft this query:
If I understand this correctly, it says find every row in the hop table that does not have a corresponding row in the hop_in_recipe table. I get about 70 or so responses. I get similar counts for fermentables and fewer for the other tables.
We need to be marking the copies as deleted, at least. I actually think we need to really delete them, since the copy cannot be accessed once it's removed from a recipe. We also probably should write something that will clean all of this up as part of an upgrade process.
The text was updated successfully, but these errors were encountered: