X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/6bcd89acf76163ca09c95903f27ceed925718061..refs/heads/ldap_host_failover:/app/Console/Commands/UpgradeDatabaseEncoding.php diff --git a/app/Console/Commands/UpgradeDatabaseEncoding.php b/app/Console/Commands/UpgradeDatabaseEncoding.php index dbdf778e8..32808729a 100644 --- a/app/Console/Commands/UpgradeDatabaseEncoding.php +++ b/app/Console/Commands/UpgradeDatabaseEncoding.php @@ -12,7 +12,7 @@ class UpgradeDatabaseEncoding extends Command * * @var string */ - protected $signature = 'bookstack:db-utf8mb4-syntax {--database= : The database connection to use.}'; + protected $signature = 'bookstack:db-utf8mb4 {--database= : The database connection to use.}'; /** * The console command description. @@ -23,7 +23,6 @@ class UpgradeDatabaseEncoding extends Command /** * Create a new command instance. - * */ public function __construct() { @@ -44,12 +43,12 @@ class UpgradeDatabaseEncoding extends Command $database = DB::getDatabaseName(); $tables = DB::select('SHOW TABLES'); - $this->line('ALTER DATABASE `'.$database.'` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); - $this->line('USE `'.$database.'`;'); + $this->line('ALTER DATABASE `' . $database . '` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->line('USE `' . $database . '`;'); $key = 'Tables_in_' . $database; foreach ($tables as $table) { $tableName = $table->$key; - $this->line('ALTER TABLE `'.$tableName.'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); + $this->line('ALTER TABLE `' . $tableName . '` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;'); } DB::setDefaultConnection($connection);