comparison core/modules/comment/src/CommentStorageSchema.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children 12f9dff5fda9
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
15 * {@inheritdoc} 15 * {@inheritdoc}
16 */ 16 */
17 protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) { 17 protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) {
18 $schema = parent::getEntitySchema($entity_type, $reset); 18 $schema = parent::getEntitySchema($entity_type, $reset);
19 19
20 $schema['comment_field_data']['indexes'] += [ 20 if ($data_table = $this->storage->getDataTable()) {
21 'comment__status_pid' => ['pid', 'status'], 21 $schema[$data_table]['indexes'] += [
22 'comment__num_new' => [ 22 'comment__status_pid' => ['pid', 'status'],
23 'entity_id', 23 'comment__num_new' => [
24 'entity_type', 24 'entity_id',
25 'comment_type', 25 'entity_type',
26 'status', 26 'comment_type',
27 'created', 27 'status',
28 'cid', 28 'created',
29 'thread', 29 'cid',
30 ], 30 'thread',
31 'comment__entity_langcode' => [ 31 ],
32 'entity_id', 32 'comment__entity_langcode' => [
33 'entity_type', 33 'entity_id',
34 'comment_type', 34 'entity_type',
35 'default_langcode', 35 'comment_type',
36 ], 36 'default_langcode',
37 ]; 37 ],
38 ];
39 }
38 40
39 return $schema; 41 return $schema;
40 } 42 }
41 43
42 /** 44 /**