Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions db/migrate/20260407120000_rename_gas_plant_inputs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'etengine/scenario_migration'

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

KEYS = {
'capacity_of_energy_power_combined_cycle_network_gas' => 'capacity_of_energy_power_combined_cycle_network_gas_dispatchable',
'capacity_of_energy_power_turbine_network_gas' => 'capacity_of_energy_power_turbine_network_gas_dispatchable',
'share_of_energy_power_combined_cycle_ccs_network_gas' => 'share_of_energy_power_combined_cycle_ccs_network_gas_dispatchable'
}.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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2026_03_10_091042) do
ActiveRecord::Schema[7.1].define(version: 2026_04_07_120000) 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
Loading