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) private static function createDb(ConnectionConfig $config)
{ {
wait(call(function() use($config) { wait(call(static function() use($config) {
$db = $config->getDatabase(); $db = $config->getDatabase();
$connection = pool($config->withDatabase(null)); $connection = pool($config->withDatabase(null));
yield $connection->query(" yield $connection->query("
CREATE DATABASE IF NOT EXISTS `{$db}` CREATE DATABASE IF NOT EXISTS `{$db}`
CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci CHARACTER SET 'utf8mb4'
COLLATE 'utf8mb4_general_ci'
"); ");
$connection->close(); $connection->close();
})); }));

View File

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