mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Fix outdated timezone references
Updates outdated timezone identifiers in the database to their current
equivalents. This resolves ArgumentError exceptions when users have
outdated timezones like "Europe/Kiev" stored in their preferences.
Timezone mappings:
- Europe/Kiev → Europe/Kyiv
- Asia/Calcutta → Asia/Kolkata
- Asia/Katmandu → Asia/Kathmandu
- Asia/Rangoon → Asia/Yangon
- Asia/Saigon → Asia/Ho_Chi_Minh
- Pacific/Ponape → Pacific/Pohnpei
- Pacific/Truk → Pacific/Chuuk
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1cfa6cfca8
commit
653decbc0b
2 changed files with 40 additions and 2 deletions
31
db/migrate/20250623162207_update_outdated_timezones.rb
Normal file
31
db/migrate/20250623162207_update_outdated_timezones.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
class UpdateOutdatedTimezones < ActiveRecord::Migration[7.2]
|
||||
TIMEZONE_MAPPINGS = {
|
||||
"Europe/Kiev" => "Europe/Kyiv",
|
||||
"Asia/Calcutta" => "Asia/Kolkata",
|
||||
"Asia/Katmandu" => "Asia/Kathmandu",
|
||||
"Asia/Rangoon" => "Asia/Yangon",
|
||||
"Asia/Saigon" => "Asia/Ho_Chi_Minh",
|
||||
"Pacific/Ponape" => "Pacific/Pohnpei",
|
||||
"Pacific/Truk" => "Pacific/Chuuk"
|
||||
}.freeze
|
||||
|
||||
def up
|
||||
TIMEZONE_MAPPINGS.each do |old_tz, new_tz|
|
||||
execute <<-SQL
|
||||
UPDATE families
|
||||
SET timezone = '#{new_tz}'
|
||||
WHERE timezone = '#{old_tz}'
|
||||
SQL
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
TIMEZONE_MAPPINGS.each do |old_tz, new_tz|
|
||||
execute <<-SQL
|
||||
UPDATE families
|
||||
SET timezone = '#{old_tz}'
|
||||
WHERE timezone = '#{new_tz}'
|
||||
SQL
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue