summaryrefslogtreecommitdiff
path: root/db/migrations/2019_06_12_000000_fix_user_languages.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-07-21 13:42:19 +0200
committerGitHub <noreply@github.com>2019-07-21 13:42:19 +0200
commit43fa21f6553bb9e46f00d0768eab56e74c842bb4 (patch)
tree00df255fcd7c3777855bee27967117440c4add8c /db/migrations/2019_06_12_000000_fix_user_languages.php
parent4f60daa29568a43ab1da761d89124308dc7b37e7 (diff)
parent1e16f4c47ec15ffea41e1fa612d205b8db2a16d1 (diff)
Merge branch 'master' into docker
Diffstat (limited to 'db/migrations/2019_06_12_000000_fix_user_languages.php')
-rw-r--r--db/migrations/2019_06_12_000000_fix_user_languages.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/db/migrations/2019_06_12_000000_fix_user_languages.php b/db/migrations/2019_06_12_000000_fix_user_languages.php
new file mode 100644
index 00000000..c7d1474c
--- /dev/null
+++ b/db/migrations/2019_06_12_000000_fix_user_languages.php
@@ -0,0 +1,34 @@
+<?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")')
+ ]);
+ }
+}