Skip to content

Commit

Permalink
Rename heatpump inputs
Browse files Browse the repository at this point in the history
Closes #1257
These sliders have been renamed in the ENTSO project.
  • Loading branch information
noracato committed Jul 4, 2022
1 parent 558de5b commit 57c7987
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions db/migrate/20220704084323_rename_heatpump_inputs.rb
@@ -0,0 +1,21 @@
require 'etengine/scenario_migration'

class RenameHeatpumpInputs < ActiveRecord::Migration[7.0]
include ETEngine::ScenarioMigration

KEYS = {
'buildings_heater_hybrid_heatpump_air_water_electricity_share' => 'buildings_space_heater_hybrid_heatpump_air_water_electricity_share',
'households_flexibility_space_heating_cop_cutoff' => 'flexibility_heat_pump_space_heating_cop_cutoff',
'households_flexibility_water_heating_cop_cutoff' => 'flexibility_heat_pump_water_heating_cop_cutoff'
}.freeze

def up
migrate_scenarios do |scenario|
KEYS.each do |old_key, new_key|
if scenario.user_values.key?(old_key)
scenario.user_values[new_key] = scenario.user_values.delete(old_key)
end
end
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2022_04_05_124115) do
ActiveRecord::Schema[7.0].define(version: 2022_07_04_084323) do
create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", limit: 191, null: false
t.string "record_type", limit: 191, null: false
Expand Down

0 comments on commit 57c7987

Please sign in to comment.