Fix foreign key constraint issue when deleting a permission or role

Currently when deleting a role or a permission, the related records which linked by foreign keys isn't deleted, so it will generate a foreign key constraint error