2019-07-08 01:47:01 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Migrations;
|
|
|
|
|
|
|
|
use Engelsystem\Database\Migration\Migration;
|
|
|
|
|
|
|
|
class FixUserLanguages extends Migration
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migration
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function up(): void
|
2019-07-08 01:47:01 +02:00
|
|
|
{
|
|
|
|
$connection = $this->schema->getConnection();
|
|
|
|
$connection
|
|
|
|
->table('users_settings')
|
|
|
|
->update([
|
|
|
|
'language' => $connection->raw('REPLACE(language, ".UTF-8", "")')
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migration
|
|
|
|
*/
|
2022-12-14 19:15:20 +01:00
|
|
|
public function down(): void
|
2019-07-08 01:47:01 +02:00
|
|
|
{
|
|
|
|
$connection = $this->schema->getConnection();
|
|
|
|
$connection
|
|
|
|
->table('users_settings')
|
|
|
|
->update([
|
|
|
|
'language' => $connection->raw('CONCAT(language, ".UTF-8")')
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|