summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-07-08 01:47:01 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2019-07-08 01:58:06 +0200
commit508695efb253d7bc0caea1fa017ed5608d774596 (patch)
tree857fe3f34a8264df52f57a2ac539b038a2bfb85c /db
parentf90ab26feedb61615bde2f94bbf5acc7e4f28342 (diff)
Replaced gettext translation with package
This allows to check if no translation is available
Diffstat (limited to 'db')
-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")')
+ ]);
+ }
+}