Skip to content

Commit

Permalink
fix(migrations) - cascade delete trades on user remove
Browse files Browse the repository at this point in the history
  • Loading branch information
George-Spanos committed Nov 21, 2023
1 parent 8a42864 commit cf941d2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ALTER TABLE pokemon_trade
DROP CONSTRAINT fk_initiator_user_pokemon_id;

ALTER TABLE pokemon_trade
DROP CONSTRAINT fk_responder_user_pokemon_id;

ALTER TABLE pokemon_trade ADD CONSTRAINT fk_initiator_user_pokemon_id FOREIGN KEY (initiator_user_pokemon_id) REFERENCES "user_pokemon" (id) ON DELETE CASCADE;
ALTER TABLE pokemon_trade ADD CONSTRAINT fk_responder_user_pokemon_id FOREIGN KEY (responder_user_pokemon_id) REFERENCES "user_pokemon" (id) ON DELETE CASCADE;

0 comments on commit cf941d2

Please sign in to comment.