mirror of
https://github.com/friendica/friendica
synced 2025-04-26 23:10:11 +00:00
Add the new charset parameter to the database creation
This commit is contained in:
parent
9209d88c4a
commit
59ff309ee5
3 changed files with 62 additions and 55 deletions
|
@ -260,6 +260,13 @@ function db_field_command($parameters, $create = true) {
|
|||
function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
|
||||
global $a, $db;
|
||||
|
||||
if (isset($a->config["system"]["db_charset"]))
|
||||
$charset = $a->config["system"]["db_charset"];
|
||||
elseif ($verbose)
|
||||
$charset = "utf8mb4";
|
||||
else
|
||||
$charset = "utf8";
|
||||
|
||||
$r = true;
|
||||
|
||||
$sql = "";
|
||||
|
@ -282,7 +289,7 @@ function db_create_table($name, $fields, $verbose, $action, $indexes=null) {
|
|||
|
||||
$sql = implode(",\n\t", $sql_rows);
|
||||
|
||||
$sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT CHARSET=utf8";
|
||||
$sql = sprintf("CREATE TABLE IF NOT EXISTS `%s` (\n\t", dbesc($name)).$sql."\n) DEFAULT CHARSET=".$charset;
|
||||
if ($verbose)
|
||||
echo $sql.";\n";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue