private function convertTableAnnotationToTableMetadata(
        Annotation\Table $tableAnnot,
        Mapping\TableMetadata $table
    ) : Mapping\TableMetadata {
        if (! empty($tableAnnot->name)) {
            $table->setName($tableAnnot->name);
        }

        if (! empty($tableAnnot->schema)) {
            $table->setSchema($tableAnnot->schema);
        }

        foreach ($tableAnnot->options as $optionName => $optionValue) {
            $table->addOption($optionName, $optionValue);
        }

        foreach ($tableAnnot->indexes as $indexAnnot) {
            $table->addIndex([
                'name'    => $indexAnnot->name,
                'columns' => $indexAnnot->columns,
                'unique'  => $indexAnnot->unique,
                'options' => $indexAnnot->options,
                'flags'   => $indexAnnot->flags,
            ]);
        }

        foreach ($tableAnnot->uniqueConstraints as $uniqueConstraintAnnot) {
            $table->addUniqueConstraint([
                'name'    => $uniqueConstraintAnnot->name,
                'columns' => $uniqueConstraintAnnot->columns,
                'options' => $uniqueConstraintAnnot->options,
                'flags'   => $uniqueConstraintAnnot->flags,
            ]);
        }

        return $table;
    }