1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Create new databases with appropriate collation

Summary: Ref T1191. We don't create new databases with appropriate collation yet.

Test Plan:
Created a new database and saw it issue:

```
>>> [10] <query> CREATE DATABASE IF NOT EXISTS `phabricator2_testo` COLLATE utf8mb4_bin
```

Reviewers: btrahan, hach-que

Reviewed By: hach-que

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10632
This commit is contained in:
epriestley 2014-10-03 06:01:21 -07:00
parent 8fbebce501
commit 3463ce8a51

View file

@ -109,10 +109,14 @@ final class PhabricatorStorageManagementAPI {
}
public function createDatabase($fragment) {
$info = $this->getCharsetInfo();
list($charset, $collate_text, $collate_sort) = $info;
queryfx(
$this->getConn(null),
'CREATE DATABASE IF NOT EXISTS %T COLLATE utf8_general_ci',
$this->getDatabaseName($fragment));
'CREATE DATABASE IF NOT EXISTS %T COLLATE %Q',
$this->getDatabaseName($fragment),
$collate_text);
}
public function createTable($fragment, $table, array $cols) {