Cascading question

  • I have two tables that I'd like to use a cascading feature in, but can't figure out how to do it. It's for an online game where there are kingdoms, empires, and relations between them. The problem is that the relations table references a 'fromID' and a 'targetID', both of which are Foreign Keys into the Empire table to the EmpireID field.

    I set up the database to cascade a deletion, so if I delete an empire, I want to delete all of the relations that are in the table for that empire, whether it created that 'relation' or not. But, the DBMS will only let me do the first cascade.

    When I try and do the second cascade, it says that I can't. I don't remember the exact error, but without it, assuming an empire that is the target is deleted, the relations will not be cancelled and I'll end up with bad rows in the relations table for the target empire.

    When declaring War or Peace on an empire, it inserts into the relations table with the fromID as the current empire and the targetID as the empire you're declaring upon. But if the target empire is deleted, that row isn't deleted.

    Anyone have any suggestions?

  • This was removed by the editor as SPAM

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply