summaryrefslogtreecommitdiff
path: root/db/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrations')
-rw-r--r--db/migrations/2018_10_01_000000_create_users_tables.php2
-rw-r--r--db/migrations/2019_06_12_000000_fix_user_languages.php34
2 files changed, 35 insertions, 1 deletions
diff --git a/db/migrations/2018_10_01_000000_create_users_tables.php b/db/migrations/2018_10_01_000000_create_users_tables.php
index d8422ca0..52b3658f 100644
--- a/db/migrations/2018_10_01_000000_create_users_tables.php
+++ b/db/migrations/2018_10_01_000000_create_users_tables.php
@@ -28,7 +28,7 @@ class CreateUsersTables extends Migration
$table->string('name', 24)->unique();
$table->string('email', 254)->unique();
- $table->string('password', 128);
+ $table->string('password', 255);
$table->string('api_key', 32);
$table->dateTime('last_login_at')->nullable();
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")')
+ ]);
+ }
+}