/**
  * @param ClassMetadata $classMetadata
  * @return null
  */
 public function createTable(ClassMetadata $classMetadata)
 {
     $attributesList = [];
     $model = ['AttributeDefinitions' => [], 'KeySchema' => [], 'ProvisionedThroughput' => ['ReadCapacityUnits' => 1, 'WriteCapacityUnits' => 1]];
     $indexes = $classMetadata->getIndexes();
     // We prevent that index from primary keys are not included
     unset($indexes[$classMetadata->buildHash($classMetadata->getIdentifierFieldNames())]);
     if (count($indexes) > 0) {
         $model['GlobalSecondaryIndexes'] = [];
         foreach ($indexes as $index) {
             $keys = [];
             foreach ($index['fields'] as $key => $type) {
                 $keys[] = ['AttributeName' => $key, 'KeyType' => $type];
                 $attributeType = $this->mapKeyTypeField($classMetadata->getTypeOfField($key));
                 if (is_null($attributeType)) {
                     throw new IncompatibleTypeException('We cannot create a GSI with key `' . $key . '` and type `' . $classMetadata->getTypeOfField($key) . '`.');
                 }
                 $attributesList[$key] = ['AttributeName' => $key, 'AttributeType' => $attributeType];
             }
             $model['GlobalSecondaryIndexes'][] = ['IndexName' => $index['name'], 'KeySchema' => $keys, 'Projection' => ['ProjectionType' => 'ALL'], 'ProvisionedThroughput' => ['ReadCapacityUnits' => 1, 'WriteCapacityUnits' => 1]];
         }
     }
     foreach ($classMetadata->getIdentifier() as $key => $field) {
         $attributesList[$key] = ['AttributeName' => $field['name'], 'AttributeType' => $this->mapTypeField($field['type'])];
         $model['KeySchema'][] = ['AttributeName' => $field['name'], 'KeyType' => $field['key']];
     }
     $model['AttributeDefinitions'] = array_values($attributesList);
     $model['TableName'] = $this->getTableName($classMetadata);
     return $this->commit('createTable', $model) ? true : false;
 }