protected function generateMorphToManyPivotTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
    {
        $morphName = $annotation->morphName;

        $tableName = ($annotation->pivotTable)
            ? $annotation->pivotTable
            : $this->generatePivotTablename($entityMetadata['class'], $annotation->relatedEntity, $annotation->inverse, $morphName);

        if ($annotation->inverse) {
            $pivotKey = $annotation->localPivotKey ?: $this->generateKey($entityMetadata['class']);
        } else {
            $pivotKey = $annotation->relatedPivotKey ?: $this->generateKey($annotation->relatedEntity);
        }

        $morphId = (! empty($annotation->localKey))
            ? $annotation->localKey
            : $morphName.'_id';

        $morphType = $morphName.'_type';

        return new TableDefinition([
            'name' => $tableName,
            'columns' => [
                $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
                    'name' => $pivotKey,
                    'options' => [
                        'autoIncrement' => false
                    ]
                ]),
                $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
                    'name' => $morphId,
                    'options' => [
                        'autoIncrement' => false
                    ]
                ]),
                new ColumnDefinition([
                    'name' => $morphType,
                    'type' => 'string',
                    'nullable' => false,
                    'default' => false,
                    'primary' => true,
                    'unique' => false,
                    'index' => false,
                    'options' => []
                ]),
            ]
        ]);
    }