Skip to content

Commit

Permalink
Merge pull request #30 from moby-it/cascade-delete-trades-on-user-rem…
Browse files Browse the repository at this point in the history
…ove-migration

fix(migrations) - cascade delete trades on user remove
  • Loading branch information
George-Spanos authored Dec 4, 2023
2 parents 25f2f6e + cf941d2 commit 95aedac
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 95aedac

Please sign in to comment.