Skip to content

Commit 984bf34

Browse files
authored
Rename de/dk scenarios' area_codes (#1598)
1 parent d1243e1 commit 984bf34

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
require 'etengine/scenario_migration'
2+
3+
class RetireDeDk2015 < ActiveRecord::Migration[7.1]
4+
include ETEngine::ScenarioMigration
5+
6+
def up
7+
migrate_scenarios do |scenario|
8+
next unless ['de', 'dk'].include?(scenario.area_code)
9+
10+
if scenario.area_code == 'de'
11+
scenario.area_code = 'DE_germany'
12+
elsif scenario.area_code == 'dk'
13+
scenario.area_code = 'DK_denmark'
14+
end
15+
end
16+
end
17+
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.1].define(version: 2025_05_19_132450) do
13+
ActiveRecord::Schema[7.1].define(version: 2025_07_02_112742) do
1414
create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
1515
t.string "name", limit: 191, null: false
1616
t.string "record_type", limit: 191, null: false

0 commit comments

Comments
 (0)