Yosodog / game

2 stars 1 forks source link

Disbanding an alliance doesn't work #43

Open Yosodog opened 7 years ago

Yosodog commented 7 years ago

When the last person leaves the alliance, an exception is thrown

SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (game.roles, CONSTRAINT roles_alliance_id_foreign FOREIGN KEY (alliance_id) REFERENCES alliances (id)) (SQL: delete from alliances where id = 1)

LordStrum commented 7 years ago

So, this is caused when you leave an alliance, because it doesn't delete roles when you do so. Therefore, when it makes the check to see if the alliance needs to be deleted, the alliance's roles do not get deleted.

Easy enough fix, I'll get to it when I can.