From 3680e04817480e0e007797f30973e402eefa70f5 Mon Sep 17 00:00:00 2001 From: akemidx Date: Mon, 18 Mar 2024 18:29:59 -0400 Subject: [PATCH 1/4] migration to set legacy locations to an standardized format --- ...4_03_18_221612_update_legacy_locations.php | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 database/migrations/2024_03_18_221612_update_legacy_locations.php diff --git a/database/migrations/2024_03_18_221612_update_legacy_locations.php b/database/migrations/2024_03_18_221612_update_legacy_locations.php new file mode 100644 index 0000000000..718022abdd --- /dev/null +++ b/database/migrations/2024_03_18_221612_update_legacy_locations.php @@ -0,0 +1,36 @@ +string('locale', 5)->nullable()->default(config('app.fallback_locale'))->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + Schema::table('users', function (Blueprint $table) { + // + $table->string('locale', 10)->nullable()->default(config('app.locale'))->change(); + }); + } +} From dc297176232f3374db27ff852d3696480f1d74b2 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 19 Mar 2024 15:51:05 -0400 Subject: [PATCH 2/4] fixing default --- .../migrations/2024_03_18_221612_update_legacy_locations.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2024_03_18_221612_update_legacy_locations.php b/database/migrations/2024_03_18_221612_update_legacy_locations.php index 718022abdd..82cbc2745e 100644 --- a/database/migrations/2024_03_18_221612_update_legacy_locations.php +++ b/database/migrations/2024_03_18_221612_update_legacy_locations.php @@ -16,7 +16,7 @@ class UpdateLegacyLocations extends Migration // Schema::table('users', function (Blueprint $table) { // - $table->string('locale', 5)->nullable()->default(config('app.fallback_locale'))->change(); + $table->string('locale', 10)->nullable()->default('en-US')->change(); }); } From 8640cad0333ca3d4c140d36076e73439ae44baf0 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 19 Mar 2024 16:11:32 -0400 Subject: [PATCH 3/4] was using lcoations and not locale. fixed --- ...locations.php => 2024_03_18_221612_update_legacy_locale.php} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename database/migrations/{2024_03_18_221612_update_legacy_locations.php => 2024_03_18_221612_update_legacy_locale.php} (94%) diff --git a/database/migrations/2024_03_18_221612_update_legacy_locations.php b/database/migrations/2024_03_18_221612_update_legacy_locale.php similarity index 94% rename from database/migrations/2024_03_18_221612_update_legacy_locations.php rename to database/migrations/2024_03_18_221612_update_legacy_locale.php index 82cbc2745e..5e86baccab 100644 --- a/database/migrations/2024_03_18_221612_update_legacy_locations.php +++ b/database/migrations/2024_03_18_221612_update_legacy_locale.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class UpdateLegacyLocations extends Migration +class UpdateLegacyLocale extends Migration { /** * Run the migrations. From b124b9af4d8a2e68851fde9f3b48f4a760e039b9 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 26 Mar 2024 16:50:39 -0400 Subject: [PATCH 4/4] adding in change to settings table --- .../2024_03_18_221612_update_legacy_locale.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/database/migrations/2024_03_18_221612_update_legacy_locale.php b/database/migrations/2024_03_18_221612_update_legacy_locale.php index 5e86baccab..dc81207b1d 100644 --- a/database/migrations/2024_03_18_221612_update_legacy_locale.php +++ b/database/migrations/2024_03_18_221612_update_legacy_locale.php @@ -18,6 +18,13 @@ class UpdateLegacyLocale extends Migration // $table->string('locale', 10)->nullable()->default('en-US')->change(); }); + + Schema::table('settings', function (Blueprint $table) { + // + $table->string('locale', 10)->nullable()->default('en-US')->change(); + }); + + } /** @@ -32,5 +39,9 @@ class UpdateLegacyLocale extends Migration // $table->string('locale', 10)->nullable()->default(config('app.locale'))->change(); }); + Schema::table('settings', function (Blueprint $table) { + // + $table->string('locale', 10)->nullable()->default(config('app.locale'))->change(); + }); } }