Chris@0: storage->getDataTable()) { Chris@17: $schema[$data_table]['unique keys'] += [ Chris@17: 'user__name' => ['name', 'langcode'], Chris@17: ]; Chris@17: } Chris@0: Chris@0: return $schema; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function processIdentifierSchema(&$schema, $key) { Chris@0: // The "users" table does not use serial identifiers. Chris@0: if ($key != $this->entityType->getKey('id')) { Chris@0: parent::processIdentifierSchema($schema, $key); Chris@0: } 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 == 'users_field_data') { Chris@0: switch ($field_name) { Chris@0: case 'name': Chris@0: // Improves the performance of the user__name index defined Chris@0: // in getEntitySchema(). Chris@0: $schema['fields'][$field_name]['not null'] = TRUE; Chris@0: // Make sure the field is no longer than 191 characters so we can Chris@0: // add a unique constraint in MySQL. Chris@18: $schema['fields'][$field_name]['length'] = UserInterface::USERNAME_MAX_LENGTH; Chris@0: break; Chris@0: Chris@0: case 'mail': Chris@0: $this->addSharedTableFieldIndex($storage_definition, $schema); Chris@0: break; Chris@0: Chris@0: case 'access': Chris@0: case 'created': 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: }