engelsystem/db/migrations/2019_06_12_000000_fix_user_...

35 lines
758 B
PHP
Raw Normal View History

<?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")')
]);
}
}