New version of mysql schema to support utf8mb4 on title, author, and content

This commit is contained in:
Mitchell Hewes 2017-01-24 08:25:59 +11:00
parent 1a4daf6c27
commit 37bb24d5ee
2 changed files with 9 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,14 @@ 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');
}
function version_1(PDO $pdo)
{