0

I would like to clarify the database table relationship between comment & field_data_comment_body.

Questions are:

  1. Is comment's body saved in field_data_comment_body table?
  2. Is comment's cid = comment_body's entity_id ?
  3. Is there any table other than these 2 contributed to comments?

1 Answer 1

3
  1. Yes.
  2. Combined with 'entity_type' = 'comment', yes. An entity (comment, node, term, user, ..) is always identified by their entity_type and entity_id.
  3. Not directly, in this case. There is also field_revision_comment_body table, which is in this case not used because comments don't support revisions (but field always needs to create one because nothing stops you from adding that field to a node and create revisions of it). There are also the field_config and field_instance_config tables which contain information about which field is attached to which entity type/bundle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.