Skip to content
Open
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
26 changes: 26 additions & 0 deletions db/migrate/20250804081157_update_reformer_capacity.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'etengine/scenario_migration'

# The full load hours of ammonia reformers and Liquid H2 regasifiers have been updated from 4690 to 7884.
#
# This migration scales ammonia reformers and Liquid H2 regasifiers in existing scenarios to account for the change.
#

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


def do_migrate()
migrate_scenarios do |scenario|
if scenario.user_values.key?('capacity_of_energy_hydrogen_lohc_reformer')
scenario.user_values['capacity_of_energy_hydrogen_lohc_reformer'] *= (4690.0 / 7884.0)
end
if scenario.user_values.key?('capacity_of_energy_hydrogen_liquid_hydrogen_regasifier')
scenario.user_values['capacity_of_energy_hydrogen_liquid_hydrogen_regasifier'] *= (4690.0 / 7884.0)
end
end
end

def up
do_migrate()
end
end
3 changes: 2 additions & 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: 2025_07_22_144555) do
ActiveRecord::Schema[7.1].define(version: 2025_08_04_081157) 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 Expand Up @@ -161,6 +161,7 @@
t.string "user_email"
end

add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "forecast_storage_orders", "scenarios"
add_foreign_key "heat_network_orders", "scenarios"
Expand Down