CourseObjectFulfillmentStorageSchema.php in Course 3.x
File
src/Schema/CourseObjectFulfillmentStorageSchema.php
View source
<?php
namespace Drupal\course\Schema;
use Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
class CourseObjectFulfillmentStorageSchema extends SqlContentEntityStorageSchema {
protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $storage_definition, $table_name, array $column_mapping) {
$schema = parent::getSharedTableFieldSchema($storage_definition, $table_name, $column_mapping);
if ($table_name === 'course_object_fulfillment' && $storage_definition
->getName() == 'cofid') {
$schema['unique keys']['coid_uid'] = [
'coid',
'uid',
];
}
return $schema;
}
}