From 8625ebb142376149a48b474cc1e7df648615e117 Mon Sep 17 00:00:00 2001 From: Jose Chirivella Date: Wed, 8 May 2024 16:04:46 -0500 Subject: [PATCH 1/2] FOUR-14196 Added a migration to set the anonymous user to be in UTC --- ...pdate_anonymous_user_timezone_to_u_t_c.php | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php diff --git a/database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php b/database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php new file mode 100644 index 0000000000..060f9a637b --- /dev/null +++ b/database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php @@ -0,0 +1,26 @@ +update([ + 'timezone' => 'UTC' + ]); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + User::where('username', '_pm4_anon_user')->update([ + 'timezone' => 'America/Los_Angeles' + ]); + } +}; From b63870a16cda4863272a1cd8848ea9e87b028b48 Mon Sep 17 00:00:00 2001 From: Jose Chirivella Date: Fri, 10 May 2024 13:36:20 -0500 Subject: [PATCH 2/2] FOUR-14973 Moved the migration to upgrades and added the timezone to the Anon seeder --- database/seeders/AnonymousUserSeeder.php | 1 + ...4_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename {database/migrations => upgrades}/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php (83%) diff --git a/database/seeders/AnonymousUserSeeder.php b/database/seeders/AnonymousUserSeeder.php index 00aeaf3ceb..984d242b35 100644 --- a/database/seeders/AnonymousUserSeeder.php +++ b/database/seeders/AnonymousUserSeeder.php @@ -24,6 +24,7 @@ public function run() 'email' => 'anonymous-pm4-user@processmaker.com', 'status' => 'ACTIVE', 'password' => Hash::make(bin2hex(random_bytes(16))), + 'timezone' => 'UTC', ] ); diff --git a/database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php b/upgrades/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php similarity index 83% rename from database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php rename to upgrades/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php index 060f9a637b..258d9b3fb1 100644 --- a/database/migrations/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php +++ b/upgrades/2024_05_08_153742_update_anonymous_user_timezone_to_u_t_c.php @@ -1,9 +1,9 @@