1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 10:54:43 +01:00

Update create table statements.

This commit is contained in:
Alexander Pankratov 2020-05-05 20:05:32 +03:00
parent ab168ce655
commit dedf20ea1b
2 changed files with 6 additions and 2 deletions

View File

@ -61,12 +61,13 @@ class Mysql
*/
private static function createDb(ConnectionConfig $config)
{
wait(call(function() use($config) {
wait(call(static function() use($config) {
$db = $config->getDatabase();
$connection = pool($config->withDatabase(null));
yield $connection->query("
CREATE DATABASE IF NOT EXISTS `{$db}`
CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
CHARACTER SET 'utf8mb4'
COLLATE 'utf8mb4_general_ci'
");
$connection->close();
}));

View File

@ -268,6 +268,9 @@ class MysqlArray implements DbArray
`ts` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`key`)
)
ENGINE = InnoDB
CHARACTER SET 'utf8mb4'
COLLATE 'utf8mb4_general_ci'
");
}