Drupal Association members fund grants that make connections all over the world.
The current changes to the comment.module in ACID compliant. While Drupal itself does not have an ACID compliant database design, there has been considerable work done to take steps towards this. The first of which is to make real foreign key constants .introduce a database design that is not
Since foreign keys can only relate to a single table, the design implemented in the changes to comment.module make this impossible.
I propose that these fields are removed the from the schema:
Instead, it would be better to have a table for each entity that related the comments to that entity.
For instance, for nodes you would have a table called comment_node (or node_comment, whichever makes more sense), the schema would look something like this:
The primary key could simply be cid. If the comment shouldn't be allowed to appear on more than one node, or if it should be able to be on more than one node, it could be a primary key of cid+nid. Regardless a pseudokey of 'id' or 'cid_nid' should not be used.
Since comments will rarely, if ever, be queried across entity types, this change introduces relatively little performance problems.
The goal of this issue is to help make Drupal's database be more stable. When foreign key support is fully implemented into Drupal, this change will prevent the database from containing comments that relate to non-existent entities. This will assist in keeping Drupal's database sanitized.