Chris@0: ['vid', 'weight', 'name'], Chris@0: 'taxonomy_term__vid_name' => ['vid', 'name'], Chris@0: ]; Chris@0: Chris@0: $schema['taxonomy_term_hierarchy'] = [ Chris@0: 'description' => 'Stores the hierarchical relationship between terms.', Chris@0: 'fields' => [ Chris@0: 'tid' => [ Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: 'description' => 'Primary Key: The {taxonomy_term_data}.tid of the term.', Chris@0: ], Chris@0: 'parent' => [ Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: 'description' => "Primary Key: The {taxonomy_term_data}.tid of the term's parent. 0 indicates no parent.", Chris@0: ], Chris@0: ], Chris@0: 'indexes' => [ Chris@0: 'parent' => ['parent'], Chris@0: ], Chris@0: 'foreign keys' => [ Chris@0: 'taxonomy_term_data' => [ Chris@0: 'table' => 'taxonomy_term_data', Chris@0: 'columns' => ['tid' => 'tid'], Chris@0: ], Chris@0: ], Chris@0: 'primary key' => ['tid', 'parent'], Chris@0: ]; Chris@0: Chris@0: $schema['taxonomy_index'] = [ Chris@0: 'description' => 'Maintains denormalized information about node/term relationships.', Chris@0: 'fields' => [ Chris@0: 'nid' => [ Chris@0: 'description' => 'The {node}.nid this record tracks.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'tid' => [ Chris@0: 'description' => 'The term ID.', Chris@0: 'type' => 'int', Chris@0: 'unsigned' => TRUE, Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: 'status' => [ Chris@0: 'description' => 'Boolean indicating whether the node is published (visible to non-administrators).', Chris@0: 'type' => 'int', Chris@0: 'not null' => TRUE, Chris@0: 'default' => 1, Chris@0: ], Chris@0: 'sticky' => [ Chris@0: 'description' => 'Boolean indicating whether the node is sticky.', Chris@0: 'type' => 'int', Chris@0: 'not null' => FALSE, Chris@0: 'default' => 0, Chris@0: 'size' => 'tiny', Chris@0: ], Chris@0: 'created' => [ Chris@0: 'description' => 'The Unix timestamp when the node was created.', Chris@0: 'type' => 'int', Chris@0: 'not null' => TRUE, Chris@0: 'default' => 0, Chris@0: ], Chris@0: ], Chris@0: 'primary key' => ['nid', 'tid'], Chris@0: 'indexes' => [ Chris@0: 'term_node' => ['tid', 'status', 'sticky', 'created'], Chris@0: ], Chris@0: 'foreign keys' => [ Chris@0: 'tracked_node' => [ Chris@0: 'table' => 'node', Chris@0: 'columns' => ['nid' => 'nid'], Chris@0: ], Chris@0: 'term' => [ Chris@0: 'table' => 'taxonomy_term_data', Chris@0: 'columns' => ['tid' => 'tid'], Chris@0: ], Chris@0: ], Chris@0: ]; Chris@0: Chris@0: return $schema; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping) { Chris@0: $schema = parent::getSharedTableFieldSchema($storage_definition, $table_name, $column_mapping); Chris@0: $field_name = $storage_definition->getName(); Chris@0: Chris@0: if ($table_name == 'taxonomy_term_field_data') { Chris@0: // Remove unneeded indexes. Chris@0: unset($schema['indexes']['taxonomy_term_field__vid__target_id']); Chris@0: unset($schema['indexes']['taxonomy_term_field__description__format']); Chris@0: Chris@0: switch ($field_name) { Chris@0: case 'weight': Chris@0: // Improves the performance of the taxonomy_term__tree index defined Chris@0: // in getEntitySchema(). Chris@0: $schema['fields'][$field_name]['not null'] = TRUE; Chris@0: break; Chris@0: Chris@0: case 'name': Chris@0: $this->addSharedTableFieldIndex($storage_definition, $schema, TRUE); Chris@0: break; Chris@0: } Chris@0: } Chris@0: Chris@0: return $schema; Chris@0: } Chris@0: Chris@0: }