You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
758 B
PHTML
35 lines
758 B
PHTML
5 years ago
|
<?php
|
||
|
|
||
|
namespace Engelsystem\Migrations;
|
||
|
|
||
|
use Engelsystem\Database\Migration\Migration;
|
||
|
|
||
|
class FixUserLanguages extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migration
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
$connection = $this->schema->getConnection();
|
||
|
$connection
|
||
|
->table('users_settings')
|
||
|
->update([
|
||
|
'language' => $connection->raw('REPLACE(language, ".UTF-8", "")')
|
||
|
]);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migration
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
$connection = $this->schema->getConnection();
|
||
|
$connection
|
||
|
->table('users_settings')
|
||
|
->update([
|
||
|
'language' => $connection->raw('CONCAT(language, ".UTF-8")')
|
||
|
]);
|
||
|
}
|
||
|
}
|