Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Fix 931 (#936)
Browse files Browse the repository at this point in the history
* Test cases : AUthentication - Auth, Forgot Password, Collections - Create, Delete

* #931

* #931
  • Loading branch information
itsmerhp authored and binal-7span committed May 16, 2019
1 parent 7393cb8 commit 343177b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/core/Directus/Database/Schema/SchemaFactory.php
Expand Up @@ -229,14 +229,17 @@ public function createColumn($name, array $data)
*
* @return \Zend\Db\Adapter\Driver\StatementInterface|\Zend\Db\ResultSet\ResultSet
*/
public function buildTable(AbstractSql $table)
public function buildTable(AbstractSql $table,$charset="")
{
$connection = $this->schemaManager->getSource()->getConnection();
$sql = new Sql($connection);


$tableQuery = $sql->buildSqlString($table);
$tableQuery = !empty($charset) ? $tableQuery."charset = ".$charset: $tableQuery;

// TODO: Allow charset and comment
return $connection->query(
$sql->buildSqlString($table),
$tableQuery,
$connection::QUERY_MODE_EXECUTE
);
}
Expand Down
7 changes: 3 additions & 4 deletions src/core/Directus/Services/TablesService.php
Expand Up @@ -1156,7 +1156,6 @@ protected function hasFieldAttributeWith(array $fields, $attribute, $value, $max
return $result;
}


/**
* @param string $name
* @param array $data
Expand All @@ -1175,11 +1174,11 @@ protected function createTableSchema($name, array $data)
/** @var Emitter $hookEmitter */
$hookEmitter = $this->container->get('hook_emitter');
$hookEmitter->run('collection.create:before', $name);

$result = $schemaFactory->buildTable($table);
$charset = $this->container->get('config')->get('database.charset');
$result = $schemaFactory->buildTable($table,$charset);

return $result ? true : false;
}
}

/**
* @param Collection $collection
Expand Down

0 comments on commit 343177b

Please sign in to comment.