Merge pull request #628

New mysql schema supports utf8mb4 on selected columns
This commit is contained in:
Frédéric Guillot 2017-01-25 21:53:43 -05:00 committed by GitHub
commit 9e296d6cc6
2 changed files with 10 additions and 2 deletions

View File

@ -47,7 +47,7 @@ function get_connection_parameters()
'password' => DB_PASSWORD,
'database' => DB_NAME,
'port' => DB_PORT,
'charset' => 'utf8',
'charset' => 'utf8mb4',
);
} else {
require_once __DIR__.'/../schemas/sqlite.php';

View File

@ -5,7 +5,15 @@ namespace Miniflux\Schema;
use PDO;
use Miniflux\Helper;
const VERSION = 1;
const VERSION = 2;
function version_2(PDO $pdo)
{
$pdo->exec('ALTER TABLE items CHANGE title title TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL');
$pdo->exec('ALTER TABLE items CHANGE author author TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
$pdo->exec('ALTER TABLE items CHANGE content content LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
$pdo->exec('ALTER TABLE feeds CHANGE title title VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci');
}
function version_1(PDO $pdo)
{