From 00ce1e9335e28e443bee67297d2598f1480b9680 Mon Sep 17 00:00:00 2001 From: bendnorman Date: Fri, 15 Sep 2023 14:36:54 -0400 Subject: [PATCH] Recreate ferc rename migration --- ...1c2c961a7be5_rename_ferc_output_assets.py} | 830 +++++++++--------- 1 file changed, 415 insertions(+), 415 deletions(-) rename migrations/versions/{660af87f81c5_rename_ferc1_output_assets.py => 1c2c961a7be5_rename_ferc_output_assets.py} (83%) diff --git a/migrations/versions/660af87f81c5_rename_ferc1_output_assets.py b/migrations/versions/1c2c961a7be5_rename_ferc_output_assets.py similarity index 83% rename from migrations/versions/660af87f81c5_rename_ferc1_output_assets.py rename to migrations/versions/1c2c961a7be5_rename_ferc_output_assets.py index 4efd02354d..ab18d0278a 100644 --- a/migrations/versions/660af87f81c5_rename_ferc1_output_assets.py +++ b/migrations/versions/1c2c961a7be5_rename_ferc_output_assets.py @@ -1,16 +1,16 @@ -"""Rename ferc1 output assets +"""Rename ferc output assets -Revision ID: 660af87f81c5 -Revises: 947f3413295c -Create Date: 2023-09-13 16:23:27.596939 +Revision ID: 1c2c961a7be5 +Revises: 2ba971d7e675 +Create Date: 2023-09-15 14:34:47.739335 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. -revision = '660af87f81c5' -down_revision = '947f3413295c' +revision = '1c2c961a7be5' +down_revision = '2ba971d7e675' branch_labels = None depends_on = None @@ -29,8 +29,8 @@ def upgrade() -> None: sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), sa.Column('starting_balance', sa.Float(), nullable=True, comment='Account balance at beginning of year.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_balance_sheet_assets_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_balance_sheet_assets_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_balance_sheet_assets_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_balance_sheet_assets_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'asset_type', name=op.f('pk_out_ferc1__yearly_balance_sheet_assets')) ) op.create_table('out_ferc1__yearly_balance_sheet_liabilities', @@ -45,8 +45,8 @@ def upgrade() -> None: sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_balance_sheet_liabilities_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_balance_sheet_liabilities_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_balance_sheet_liabilities_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_balance_sheet_liabilities_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type', name=op.f('pk_out_ferc1__yearly_balance_sheet_liabilities')) ) op.create_table('out_ferc1__yearly_cash_flow', @@ -59,8 +59,8 @@ def upgrade() -> None: sa.Column('amount', sa.Float(), nullable=True, comment='Reported amount of dollars. This could be a balance or a change in value.'), sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_cash_flow_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_cash_flow_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_cash_flow_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_cash_flow_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type', name=op.f('pk_out_ferc1__yearly_cash_flow')) ) op.create_table('out_ferc1__yearly_depreciation_amortization_summary', @@ -73,8 +73,8 @@ def upgrade() -> None: sa.Column('ferc_account_label', sa.Text(), nullable=False, comment='Long FERC account identifier derived from values reported in the XBRL taxonomies. May also refer to aggregations of individual FERC accounts.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('dollar_value', sa.Float(), nullable=True, comment='Dollar value of reported income, expense, asset, or liability.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_depreciation_amortization_summary_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_depreciation_amortization_summary_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_depreciation_amortization_summary_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_depreciation_amortization_summary_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label', name=op.f('pk_out_ferc1__yearly_depreciation_amortization_summary')) ) op.create_table('out_ferc1__yearly_electric_energy_dispositions', @@ -86,8 +86,8 @@ def upgrade() -> None: sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), sa.Column('energy_mwh', sa.Float(), nullable=True, comment='Sources and uses of energy in MWh.'), sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_energy_dispositions_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_energy_dispositions_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_energy_dispositions_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_energy_dispositions_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type', name=op.f('pk_out_ferc1__yearly_electric_energy_dispositions')) ) op.create_table('out_ferc1__yearly_electric_energy_sources', @@ -99,8 +99,8 @@ def upgrade() -> None: sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), sa.Column('energy_mwh', sa.Float(), nullable=True, comment='Sources and uses of energy in MWh.'), sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_energy_sources_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_energy_sources_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_energy_sources_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_energy_sources_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type', name=op.f('pk_out_ferc1__yearly_electric_energy_sources')) ) op.create_table('out_ferc1__yearly_electric_operating_expenses', @@ -113,8 +113,8 @@ def upgrade() -> None: sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_operating_expenses_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_operating_expenses_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_operating_expenses_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_operating_expenses_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type', name=op.f('pk_out_ferc1__yearly_electric_operating_expenses')) ) op.create_table('out_ferc1__yearly_electric_operating_revenues', @@ -129,8 +129,8 @@ def upgrade() -> None: sa.Column('avg_customers_per_month', sa.Float(), nullable=True, comment='Average number of customers per month.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_operating_revenues_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_operating_revenues_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_operating_revenues_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_operating_revenues_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type', name=op.f('pk_out_ferc1__yearly_electric_operating_revenues')) ) op.create_table('out_ferc1__yearly_electric_plant_depreciation_changes', @@ -146,8 +146,8 @@ def upgrade() -> None: sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_changes_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_changes_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_changes_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_changes_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type', name=op.f('pk_out_ferc1__yearly_electric_plant_depreciation_changes')) ) op.create_table('out_ferc1__yearly_electric_plant_depreciation_functional', @@ -163,8 +163,8 @@ def upgrade() -> None: sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_functional_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_functional_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_functional_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electric_plant_depreciation_functional_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type', name=op.f('pk_out_ferc1__yearly_electric_plant_depreciation_functional')) ) op.create_table('out_ferc1__yearly_electricity_sales_by_rate_schedule', @@ -181,8 +181,8 @@ def upgrade() -> None: sa.Column('kwh_per_customer', sa.Float(), nullable=True, comment='kwh per customer.'), sa.Column('revenue_per_kwh', sa.Float(), nullable=True), sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electricity_sales_by_rate_schedule_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electricity_sales_by_rate_schedule_utility_id_pudl_utilities_pudl')) + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_electricity_sales_by_rate_schedule_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_electricity_sales_by_rate_schedule_utility_id_pudl_core_pudl__entity_utilities_pudl')) ) op.create_table('out_ferc1__yearly_income_statement', sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), @@ -196,8 +196,8 @@ def upgrade() -> None: sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_income_statement_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_income_statement_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_income_statement_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_income_statement_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type', name=op.f('pk_out_ferc1__yearly_income_statement')) ) op.create_table('out_ferc1__yearly_other_regulatory_liabilities', @@ -211,8 +211,8 @@ def upgrade() -> None: sa.Column('increase_in_other_regulatory_liabilities', sa.Float(), nullable=True, comment='The increase during the reporting period of other regulatory liabilities.'), sa.Column('account_detail', sa.Text(), nullable=True, comment='Description of the account number credited from making debit adjustment to other regulatory liabilities.'), sa.Column('decrease_in_other_regulatory_liabilities', sa.Float(), nullable=True, comment='The decrease during the reporting period of other regulatory liabilities.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_other_regulatory_liabilities_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_other_regulatory_liabilities_utility_id_pudl_utilities_pudl')) + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_other_regulatory_liabilities_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_other_regulatory_liabilities_utility_id_pudl_core_pudl__entity_utilities_pudl')) ) op.create_table('out_ferc1__yearly_plant_in_service', sa.Column('report_year', sa.Integer(), nullable=False, comment='Four-digit year in which the data was reported.'), @@ -229,8 +229,8 @@ def upgrade() -> None: sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), sa.Column('starting_balance', sa.Float(), nullable=True, comment='Account balance at beginning of year.'), sa.Column('transfers', sa.Float(), nullable=True, comment='Cost of transfers into (out of) the account.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_plant_in_service_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_plant_in_service_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_plant_in_service_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_plant_in_service_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'ferc_account_label', name=op.f('pk_out_ferc1__yearly_plant_in_service')) ) op.create_table('out_ferc1__yearly_purchased_power', @@ -253,8 +253,8 @@ def upgrade() -> None: sa.Column('tariff', sa.Text(), nullable=True, comment='FERC Rate Schedule Number or Tariff. (Note: may be incomplete if originally reported on multiple lines.)'), sa.Column('total_settlement', sa.Float(), nullable=True, comment='Sum of demand, energy, and other charges (USD). For power exchanges, the settlement amount for the net receipt of energy. If more energy was delivered than received, this amount is negative.'), sa.ForeignKeyConstraint(['purchase_type_code'], ['core_ferc1__codes_power_purchase_types.code'], name=op.f('fk_out_ferc1__yearly_purchased_power_purchase_type_code_core_ferc1__codes_power_purchase_types')), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_purchased_power_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_purchased_power_utility_id_pudl_utilities_pudl')) + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_purchased_power_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_purchased_power_utility_id_pudl_core_pudl__entity_utilities_pudl')) ) op.create_table('out_ferc1__yearly_retained_earnings', sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'), @@ -268,8 +268,8 @@ def upgrade() -> None: sa.Column('balance', sa.Text(), nullable=True, comment='Indication of whether a column is a credit or debit, as reported in the XBRL taxonomy.'), sa.Column('ferc_account', sa.Text(), nullable=True, comment="Actual FERC Account number (e.g. '359.1') if available, or a PUDL assigned ID when FERC accounts have been split or combined in reporting."), sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_retained_earnings_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_retained_earnings_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_retained_earnings_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_retained_earnings_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type', name=op.f('pk_out_ferc1__yearly_retained_earnings')) ) op.create_table('out_ferc1__yearly_transmission_statistics', @@ -294,8 +294,8 @@ def upgrade() -> None: sa.Column('opex_maintenance', sa.Float(), nullable=True, comment='Production expenses: Maintenance (USD).'), sa.Column('opex_rents', sa.Float(), nullable=True, comment='Production expenses: rents (USD).'), sa.Column('opex_total', sa.Float(), nullable=True, comment='Total production expenses, excluding fuel (USD).'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_transmission_statistics_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_transmission_statistics_utility_id_pudl_utilities_pudl')) + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_transmission_statistics_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_transmission_statistics_utility_id_pudl_core_pudl__entity_utilities_pudl')) ) op.create_table('out_ferc1__yearly_utility_plant_summary', sa.Column('utility_id_ferc1', sa.Integer(), nullable=False, comment='PUDL-assigned utility ID, identifying a FERC1 utility. This is an auto-incremented ID and is not expected to be stable from year to year.'), @@ -308,8 +308,8 @@ def upgrade() -> None: sa.Column('row_type_xbrl', sa.Enum('calculated_value', 'reported_value', 'correction'), nullable=True, comment='Indicates whether the value reported in the row is calculated, or uniquely reported within the table.'), sa.Column('ending_balance', sa.Float(), nullable=True, comment='Account balance at end of year.'), sa.Column('record_id', sa.Text(), nullable=True, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_utility_plant_summary_utility_id_ferc1_utilities_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_utility_plant_summary_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name=op.f('fk_out_ferc1__yearly_utility_plant_summary_utility_id_ferc1_core_pudl__assn_utilities_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_utility_plant_summary_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'utility_plant_asset_type', name=op.f('pk_out_ferc1__yearly_utility_plant_summary')) ) op.create_table('_out_ferc1__yearly_hydro_plants', @@ -355,9 +355,9 @@ def upgrade() -> None: sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'), sa.Column('plant_type', sa.Text(), nullable=True), sa.Column('project_num', sa.Integer(), nullable=True, comment='FERC Licensed Project Number.'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_hydro_plants_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_hydro_plants_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_hydro_plants_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_hydro_plants_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_hydro_plants_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_hydro_plants_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('record_id', name=op.f('pk__out_ferc1__yearly_hydro_plants')) ) op.create_table('_out_ferc1__yearly_plants_utilities', @@ -366,9 +366,9 @@ def upgrade() -> None: sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'), sa.Column('utility_name_ferc1', sa.Text(), nullable=True, comment='Name of the responding utility, as it is reported in FERC Form 1. For human readability only.'), sa.Column('utility_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL utility ID. May not be stable over time.'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_plants_utilities_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_plants_utilities_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_plants_utilities_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_plants_utilities_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_plants_utilities_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_plants_utilities_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('utility_id_ferc1', 'plant_name_ferc1', name=op.f('pk__out_ferc1__yearly_plants_utilities')) ) op.create_table('_out_ferc1__yearly_pumped_storage_plants', @@ -418,9 +418,9 @@ def upgrade() -> None: sa.Column('plant_hours_connected_while_generating', sa.Float(), nullable=True, comment='Hours the plant was connected to load while generating in the report year.'), sa.Column('plant_id_pudl', sa.Integer(), nullable=True, comment='A manually assigned PUDL plant ID. May not be constant over time.'), sa.Column('project_num', sa.Integer(), nullable=True, comment='FERC Licensed Project Number.'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_pumped_storage_plants_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_pumped_storage_plants_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_pumped_storage_plants_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_pumped_storage_plants_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_pumped_storage_plants_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_pumped_storage_plants_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('record_id', name=op.f('pk__out_ferc1__yearly_pumped_storage_plants')) ) op.create_table('_out_ferc1__yearly_small_plants', @@ -446,9 +446,9 @@ def upgrade() -> None: sa.Column('opex_total_nonfuel', sa.Float(), nullable=True, comment='Total production expenses, excluding fuel (USD).'), sa.Column('peak_demand_mw', sa.Float(), nullable=True, comment='Net peak demand for 60 minutes. Note: in some cases peak demand for other time periods may have been reported instead, if hourly peak demand was unavailable.'), sa.Column('plant_type', sa.Text(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_small_plants_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_small_plants_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_small_plants_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_small_plants_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_small_plants_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_small_plants_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('record_id', name=op.f('pk__out_ferc1__yearly_small_plants')) ) op.create_table('_out_ferc1__yearly_steam_plants', @@ -507,9 +507,9 @@ def upgrade() -> None: sa.Column('plant_type', sa.Text(), nullable=True), sa.Column('record_id', sa.Text(), nullable=False, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), sa.Column('water_limited_capacity_mw', sa.Float(), nullable=True, comment='Plant capacity in MW when limited by condenser water.'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_steam_plants_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_steam_plants_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_steam_plants_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk__out_ferc1__yearly_steam_plants_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk__out_ferc1__yearly_steam_plants_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk__out_ferc1__yearly_steam_plants_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('record_id', name=op.f('pk__out_ferc1__yearly_steam_plants')) ) op.create_table('out_ferc1__yearly_all_plants', @@ -591,9 +591,9 @@ def upgrade() -> None: sa.Column('opex_production_before_pumping', sa.Float(), nullable=True, comment='Total production expenses before pumping (USD).'), sa.Column('opex_pumped_storage', sa.Float(), nullable=True, comment='Production expenses: pumped storage (USD).'), sa.Column('opex_pumping', sa.Float(), nullable=True, comment='Production expenses: We are here to PUMP YOU UP! (USD).'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_out_ferc1__yearly_all_plants_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_out_ferc1__yearly_all_plants_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_all_plants_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk_out_ferc1__yearly_all_plants_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk_out_ferc1__yearly_all_plants_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_all_plants_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('record_id', name=op.f('pk_out_ferc1__yearly_all_plants')) ) op.create_table('out_ferc1__yearly_fuel', @@ -613,9 +613,9 @@ def upgrade() -> None: sa.Column('fuel_type_code_pudl', sa.Enum('coal', 'gas', 'hydro', 'nuclear', 'oil', 'other', 'solar', 'waste', 'wind'), nullable=True, comment='Simplified fuel type code used in PUDL'), sa.Column('fuel_units', sa.Enum('mmbtu', 'gramsU', 'kg', 'mwhth', 'kgal', 'bbl', 'klbs', 'mcf', 'gal', 'mwdth', 'btu', 'ton'), nullable=True, comment='Reported unit of measure for fuel.'), sa.Column('record_id', sa.Text(), nullable=False, comment='Identifier indicating original FERC Form 1 source record. format: {table_name}_{report_year}_{report_prd}_{respondent_id}_{spplmnt_num}_{row_number}. Unique within FERC Form 1 DB tables which are not row-mapped.'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_out_ferc1__yearly_fuel_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk_out_ferc1__yearly_fuel_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('record_id', name=op.f('pk_out_ferc1__yearly_fuel')) ) op.create_table('out_ferc1__yearly_fuel_by_plant', @@ -639,125 +639,139 @@ def upgrade() -> None: sa.Column('primary_fuel_by_mmbtu', sa.Text(), nullable=True, comment='Primary fuel for plant as a percentage of heat content.'), sa.Column('waste_fraction_cost', sa.Float(), nullable=True, comment='Waste-heat cost as a percentage of overall fuel cost.'), sa.Column('waste_fraction_mmbtu', sa.Float(), nullable=True, comment='Waste-heat heat content as a percentage of overall fuel heat content (MMBtu).'), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_by_plant_plant_id_pudl_plants_pudl')), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name=op.f('fk_out_ferc1__yearly_fuel_by_plant_utility_id_ferc1_plants_ferc1')), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_by_plant_utility_id_pudl_utilities_pudl')), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_by_plant_plant_id_pudl_core_pudl__entity_plants_pudl')), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name=op.f('fk_out_ferc1__yearly_fuel_by_plant_utility_id_ferc1_core_pudl__assn_plants_ferc1')), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name=op.f('fk_out_ferc1__yearly_fuel_by_plant_utility_id_pudl_core_pudl__entity_utilities_pudl')), sa.PrimaryKeyConstraint('report_year', 'utility_id_ferc1', 'plant_name_ferc1', name=op.f('pk_out_ferc1__yearly_fuel_by_plant')) ) - op.drop_table('denorm_electric_energy_dispositions_ferc1') - op.drop_table('denorm_plants_all_ferc1') - op.drop_table('denorm_electric_operating_expenses_ferc1') - op.drop_table('denorm_electric_plant_depreciation_functional_ferc1') - op.drop_table('denorm_income_statement_ferc1') - op.drop_table('denorm_electric_plant_depreciation_changes_ferc1') + op.drop_table('denorm_plants_small_ferc1') op.drop_table('denorm_plant_in_service_ferc1') op.drop_table('denorm_plants_steam_ferc1') - op.drop_table('denorm_depreciation_amortization_summary_ferc1') - op.drop_table('denorm_utility_plant_summary_ferc1') + op.drop_table('denorm_income_statement_ferc1') op.drop_table('denorm_other_regulatory_liabilities_ferc1') - op.drop_table('denorm_balance_sheet_liabilities_ferc1') + op.drop_table('denorm_utility_plant_summary_ferc1') + op.drop_table('denorm_transmission_statistics_ferc1') + op.drop_table('denorm_electricity_sales_by_rate_schedule_ferc1') + op.drop_table('denorm_plants_hydro_ferc1') + op.drop_table('denorm_electric_operating_expenses_ferc1') + op.drop_table('denorm_cash_flow_ferc1') op.drop_table('denorm_purchased_power_ferc1') + op.drop_table('denorm_plants_all_ferc1') op.drop_table('denorm_plants_pumped_storage_ferc1') - op.drop_table('denorm_plants_small_ferc1') - op.drop_table('denorm_plants_hydro_ferc1') op.drop_table('denorm_fuel_by_plant_ferc1') - op.drop_table('denorm_cash_flow_ferc1') + op.drop_table('denorm_electric_operating_revenues_ferc1') + op.drop_table('denorm_electric_plant_depreciation_functional_ferc1') + op.drop_table('denorm_electric_energy_dispositions_ferc1') op.drop_table('denorm_balance_sheet_assets_ferc1') - op.drop_table('denorm_transmission_statistics_ferc1') op.drop_table('denorm_plants_utilities_ferc1') - op.drop_table('denorm_fuel_ferc1') - op.drop_table('denorm_electric_energy_sources_ferc1') - op.drop_table('denorm_electric_operating_revenues_ferc1') + op.drop_table('denorm_balance_sheet_liabilities_ferc1') op.drop_table('denorm_retained_earnings_ferc1') - op.drop_table('denorm_electricity_sales_by_rate_schedule_ferc1') + op.drop_table('denorm_depreciation_amortization_summary_ferc1') + op.drop_table('denorm_electric_plant_depreciation_changes_ferc1') + op.drop_table('denorm_electric_energy_sources_ferc1') + op.drop_table('denorm_fuel_ferc1') # ### end Alembic commands ### def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### - op.create_table('denorm_electricity_sales_by_rate_schedule_ferc1', + op.create_table('denorm_fuel_ferc1', + sa.Column('report_year', sa.INTEGER(), nullable=True), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=True), - sa.Column('rate_schedule_type', sa.TEXT(), nullable=True), - sa.Column('billing_status', sa.TEXT(), nullable=True), - sa.Column('rate_schedule_description', sa.TEXT(), nullable=True), - sa.Column('sales_mwh', sa.FLOAT(), nullable=True), - sa.Column('dollar_value', sa.FLOAT(), nullable=True), - sa.Column('avg_customers_per_month', sa.FLOAT(), nullable=True), - sa.Column('kwh_per_customer', sa.FLOAT(), nullable=True), - sa.Column('revenue_per_kwh', sa.FLOAT(), nullable=True), + sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('plant_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('fuel_consumed_mmbtu', sa.FLOAT(), nullable=True), + sa.Column('fuel_consumed_total_cost', sa.FLOAT(), nullable=True), + sa.Column('fuel_consumed_units', sa.FLOAT(), nullable=True), + sa.Column('fuel_cost_per_mmbtu', sa.FLOAT(), nullable=True), + sa.Column('fuel_cost_per_unit_burned', sa.FLOAT(), nullable=True), + sa.Column('fuel_cost_per_unit_delivered', sa.FLOAT(), nullable=True), + sa.Column('fuel_mmbtu_per_unit', sa.FLOAT(), nullable=True), + sa.Column('fuel_type_code_pudl', sa.VARCHAR(length=7), nullable=True), + sa.Column('fuel_units', sa.VARCHAR(length=6), nullable=True), + sa.Column('record_id', sa.TEXT(), nullable=False), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_fuel_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_fuel_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_fuel_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('record_id', name='pk_denorm_fuel_ferc1') + ) + op.create_table('denorm_electric_energy_sources_ferc1', + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('energy_source_type', sa.TEXT(), nullable=False), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.Column('energy_mwh', sa.FLOAT(), nullable=True), sa.Column('record_id', sa.TEXT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electricity_sales_by_rate_schedule_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electricity_sales_by_rate_schedule_ferc1_utility_id_pudl_utilities_pudl') + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_energy_sources_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_energy_sources_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type', name='pk_denorm_electric_energy_sources_ferc1') ) - op.create_table('denorm_retained_earnings_ferc1', + op.create_table('denorm_electric_plant_depreciation_changes_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('depreciation_type', sa.TEXT(), nullable=False), + sa.Column('plant_status', sa.TEXT(), nullable=False), + sa.Column('utility_type', sa.TEXT(), nullable=False), + sa.Column('dollar_value', sa.FLOAT(), nullable=True), sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('earnings_type', sa.TEXT(), nullable=False), - sa.Column('starting_balance', sa.FLOAT(), nullable=True), - sa.Column('ending_balance', sa.FLOAT(), nullable=True), sa.Column('balance', sa.TEXT(), nullable=True), sa.Column('ferc_account', sa.TEXT(), nullable=True), sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_retained_earnings_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_retained_earnings_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type', name='pk_denorm_retained_earnings_ferc1') + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_plant_depreciation_changes_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_plant_depreciation_changes_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type', name='pk_denorm_electric_plant_depreciation_changes_ferc1') ) - op.create_table('denorm_electric_operating_revenues_ferc1', + op.create_table('denorm_depreciation_amortization_summary_ferc1', + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('revenue_type', sa.TEXT(), nullable=False), - sa.Column('dollar_value', sa.FLOAT(), nullable=True), - sa.Column('sales_mwh', sa.FLOAT(), nullable=True), - sa.Column('avg_customers_per_month', sa.FLOAT(), nullable=True), + sa.Column('plant_function', sa.TEXT(), nullable=False), + sa.Column('ferc_account_label', sa.TEXT(), nullable=False), sa.Column('ferc_account', sa.TEXT(), nullable=True), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_operating_revenues_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_operating_revenues_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type', name='pk_denorm_electric_operating_revenues_ferc1') + sa.Column('dollar_value', sa.FLOAT(), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_depreciation_amortization_summary_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_depreciation_amortization_summary_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label', name='pk_denorm_depreciation_amortization_summary_ferc1') ) - op.create_table('denorm_electric_energy_sources_ferc1', + op.create_table('denorm_retained_earnings_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('energy_source_type', sa.TEXT(), nullable=False), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.Column('energy_mwh', sa.FLOAT(), nullable=True), sa.Column('record_id', sa.TEXT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_energy_sources_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_energy_sources_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_source_type', name='pk_denorm_electric_energy_sources_ferc1') + sa.Column('earnings_type', sa.TEXT(), nullable=False), + sa.Column('starting_balance', sa.FLOAT(), nullable=True), + sa.Column('ending_balance', sa.FLOAT(), nullable=True), + sa.Column('balance', sa.TEXT(), nullable=True), + sa.Column('ferc_account', sa.TEXT(), nullable=True), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_retained_earnings_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_retained_earnings_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'earnings_type', name='pk_denorm_retained_earnings_ferc1') ) - op.create_table('denorm_fuel_ferc1', - sa.Column('report_year', sa.INTEGER(), nullable=True), - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), + op.create_table('denorm_balance_sheet_liabilities_ferc1', + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('plant_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('fuel_consumed_mmbtu', sa.FLOAT(), nullable=True), - sa.Column('fuel_consumed_total_cost', sa.FLOAT(), nullable=True), - sa.Column('fuel_consumed_units', sa.FLOAT(), nullable=True), - sa.Column('fuel_cost_per_mmbtu', sa.FLOAT(), nullable=True), - sa.Column('fuel_cost_per_unit_burned', sa.FLOAT(), nullable=True), - sa.Column('fuel_cost_per_unit_delivered', sa.FLOAT(), nullable=True), - sa.Column('fuel_mmbtu_per_unit', sa.FLOAT(), nullable=True), - sa.Column('fuel_type_code_pudl', sa.VARCHAR(length=7), nullable=True), - sa.Column('fuel_units', sa.VARCHAR(length=6), nullable=True), - sa.Column('record_id', sa.TEXT(), nullable=False), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_fuel_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_fuel_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_fuel_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('record_id', name='pk_denorm_fuel_ferc1') + sa.Column('starting_balance', sa.FLOAT(), nullable=True), + sa.Column('ending_balance', sa.FLOAT(), nullable=True), + sa.Column('liability_type', sa.TEXT(), nullable=False), + sa.Column('balance', sa.TEXT(), nullable=True), + sa.Column('ferc_account', sa.TEXT(), nullable=True), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_balance_sheet_liabilities_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_balance_sheet_liabilities_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type', name='pk_denorm_balance_sheet_liabilities_ferc1') ) op.create_table('denorm_plants_utilities_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), @@ -765,36 +779,11 @@ def downgrade() -> None: sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_plants_utilities_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_utilities_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_utilities_ferc1_utility_id_pudl_utilities_pudl'), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_plants_utilities_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_utilities_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_utilities_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), sa.PrimaryKeyConstraint('utility_id_ferc1', 'plant_name_ferc1', name='pk_denorm_plants_utilities_ferc1') ) - op.create_table('denorm_transmission_statistics_ferc1', - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=True), - sa.Column('start_point', sa.TEXT(), nullable=True), - sa.Column('end_point', sa.TEXT(), nullable=True), - sa.Column('operating_voltage_kv', sa.FLOAT(), nullable=True), - sa.Column('designed_voltage_kv', sa.FLOAT(), nullable=True), - sa.Column('supporting_structure_type', sa.TEXT(), nullable=True), - sa.Column('transmission_line_length_miles', sa.FLOAT(), nullable=True), - sa.Column('transmission_line_and_structures_length_miles', sa.FLOAT(), nullable=True), - sa.Column('num_transmission_circuits', sa.INTEGER(), nullable=True), - sa.Column('conductor_size_and_material', sa.TEXT(), nullable=True), - sa.Column('capex_land', sa.FLOAT(), nullable=True), - sa.Column('capex_other', sa.FLOAT(), nullable=True), - sa.Column('capex_total', sa.FLOAT(), nullable=True), - sa.Column('opex_operations', sa.FLOAT(), nullable=True), - sa.Column('opex_maintenance', sa.FLOAT(), nullable=True), - sa.Column('opex_rents', sa.FLOAT(), nullable=True), - sa.Column('opex_total', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_transmission_statistics_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_transmission_statistics_ferc1_utility_id_pudl_utilities_pudl') - ) op.create_table('denorm_balance_sheet_assets_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=False), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), @@ -807,23 +796,55 @@ def downgrade() -> None: sa.Column('ferc_account', sa.TEXT(), nullable=True), sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), sa.Column('starting_balance', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_balance_sheet_assets_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_balance_sheet_assets_ferc1_utility_id_pudl_utilities_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_balance_sheet_assets_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_balance_sheet_assets_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'asset_type', name='pk_denorm_balance_sheet_assets_ferc1') ) - op.create_table('denorm_cash_flow_ferc1', - sa.Column('record_id', sa.TEXT(), nullable=True), + op.create_table('denorm_electric_energy_dispositions_ferc1', + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('energy_disposition_type', sa.TEXT(), nullable=False), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.Column('energy_mwh', sa.FLOAT(), nullable=True), + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_energy_dispositions_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_energy_dispositions_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type', name='pk_denorm_electric_energy_dispositions_ferc1') + ) + op.create_table('denorm_electric_plant_depreciation_functional_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('amount_type', sa.TEXT(), nullable=False), - sa.Column('amount', sa.FLOAT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('plant_function', sa.TEXT(), nullable=False), + sa.Column('plant_status', sa.TEXT(), nullable=False), + sa.Column('utility_type', sa.TEXT(), nullable=False), + sa.Column('ending_balance', sa.FLOAT(), nullable=True), + sa.Column('record_id', sa.TEXT(), nullable=True), sa.Column('balance', sa.TEXT(), nullable=True), + sa.Column('ferc_account', sa.TEXT(), nullable=True), sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_cash_flow_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_cash_flow_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type', name='pk_denorm_cash_flow_ferc1') + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_plant_depreciation_functional_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_plant_depreciation_functional_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type', name='pk_denorm_electric_plant_depreciation_functional_ferc1') + ) + op.create_table('denorm_electric_operating_revenues_ferc1', + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.Column('revenue_type', sa.TEXT(), nullable=False), + sa.Column('dollar_value', sa.FLOAT(), nullable=True), + sa.Column('sales_mwh', sa.FLOAT(), nullable=True), + sa.Column('avg_customers_per_month', sa.FLOAT(), nullable=True), + sa.Column('ferc_account', sa.TEXT(), nullable=True), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_operating_revenues_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_operating_revenues_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'revenue_type', name='pk_denorm_electric_operating_revenues_ferc1') ) op.create_table('denorm_fuel_by_plant_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=False), @@ -846,12 +867,12 @@ def downgrade() -> None: sa.Column('primary_fuel_by_mmbtu', sa.TEXT(), nullable=True), sa.Column('waste_fraction_cost', sa.FLOAT(), nullable=True), sa.Column('waste_fraction_mmbtu', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_fuel_by_plant_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_fuel_by_plant_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_fuel_by_plant_ferc1_utility_id_pudl_utilities_pudl'), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_fuel_by_plant_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_fuel_by_plant_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_fuel_by_plant_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), sa.PrimaryKeyConstraint('report_year', 'utility_id_ferc1', 'plant_name_ferc1', name='pk_denorm_fuel_by_plant_ferc1') ) - op.create_table('denorm_plants_hydro_ferc1', + op.create_table('denorm_plants_pumped_storage_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=True), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), @@ -862,72 +883,183 @@ def downgrade() -> None: sa.Column('avg_num_employees', sa.FLOAT(), nullable=True), sa.Column('capacity_factor', sa.FLOAT(), nullable=True), sa.Column('capacity_mw', sa.FLOAT(), nullable=True), - sa.Column('capex_equipment', sa.FLOAT(), nullable=True), + sa.Column('capex_equipment_electric', sa.FLOAT(), nullable=True), + sa.Column('capex_equipment_misc', sa.FLOAT(), nullable=True), sa.Column('capex_facilities', sa.FLOAT(), nullable=True), sa.Column('capex_land', sa.FLOAT(), nullable=True), sa.Column('capex_per_mw', sa.FLOAT(), nullable=True), sa.Column('capex_roads', sa.FLOAT(), nullable=True), sa.Column('capex_structures', sa.FLOAT(), nullable=True), sa.Column('capex_total', sa.FLOAT(), nullable=True), + sa.Column('capex_wheels_turbines_generators', sa.FLOAT(), nullable=True), sa.Column('construction_type', sa.VARCHAR(length=12), nullable=True), sa.Column('construction_year', sa.INTEGER(), nullable=True), + sa.Column('energy_used_for_pumping_mwh', sa.FLOAT(), nullable=True), sa.Column('installation_year', sa.INTEGER(), nullable=True), - sa.Column('net_capacity_adverse_conditions_mw', sa.FLOAT(), nullable=True), - sa.Column('net_capacity_favorable_conditions_mw', sa.FLOAT(), nullable=True), sa.Column('net_generation_mwh', sa.FLOAT(), nullable=True), + sa.Column('net_load_mwh', sa.FLOAT(), nullable=True), sa.Column('opex_dams', sa.FLOAT(), nullable=True), sa.Column('opex_electric', sa.FLOAT(), nullable=True), sa.Column('opex_engineering', sa.FLOAT(), nullable=True), sa.Column('opex_generation_misc', sa.FLOAT(), nullable=True), - sa.Column('opex_hydraulic', sa.FLOAT(), nullable=True), sa.Column('opex_misc_plant', sa.FLOAT(), nullable=True), sa.Column('opex_operations', sa.FLOAT(), nullable=True), sa.Column('opex_per_mwh', sa.FLOAT(), nullable=True), sa.Column('opex_plant', sa.FLOAT(), nullable=True), + sa.Column('opex_production_before_pumping', sa.FLOAT(), nullable=True), + sa.Column('opex_pumped_storage', sa.FLOAT(), nullable=True), + sa.Column('opex_pumping', sa.FLOAT(), nullable=True), sa.Column('opex_rents', sa.FLOAT(), nullable=True), sa.Column('opex_structures', sa.FLOAT(), nullable=True), sa.Column('opex_total', sa.FLOAT(), nullable=True), sa.Column('opex_total_nonfuel', sa.FLOAT(), nullable=True), sa.Column('opex_water_for_power', sa.FLOAT(), nullable=True), sa.Column('peak_demand_mw', sa.FLOAT(), nullable=True), + sa.Column('plant_capability_mw', sa.FLOAT(), nullable=True), sa.Column('plant_hours_connected_while_generating', sa.FLOAT(), nullable=True), sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('plant_type', sa.TEXT(), nullable=True), sa.Column('project_num', sa.INTEGER(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_plants_hydro_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_hydro_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_hydro_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_hydro_ferc1') + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_plants_pumped_storage_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_pumped_storage_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_pumped_storage_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_pumped_storage_ferc1') ) - op.create_table('denorm_plants_small_ferc1', + op.create_table('denorm_plants_all_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=True), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('plant_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('plant_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('record_id', sa.TEXT(), nullable=False), + sa.Column('asset_retirement_cost', sa.FLOAT(), nullable=True), + sa.Column('avg_num_employees', sa.FLOAT(), nullable=True), + sa.Column('capacity_factor', sa.FLOAT(), nullable=True), sa.Column('capacity_mw', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_addition', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_addition_rolling', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_per_kw', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_per_mw', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_per_mw_rolling', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_per_mwh', sa.FLOAT(), nullable=True), + sa.Column('capex_annual_per_mwh_rolling', sa.FLOAT(), nullable=True), + sa.Column('capex_equipment', sa.FLOAT(), nullable=True), + sa.Column('capex_land', sa.FLOAT(), nullable=True), sa.Column('capex_per_mw', sa.FLOAT(), nullable=True), + sa.Column('capex_structures', sa.FLOAT(), nullable=True), sa.Column('capex_total', sa.FLOAT(), nullable=True), + sa.Column('capex_wo_retirement_total', sa.FLOAT(), nullable=True), + sa.Column('construction_type', sa.VARCHAR(length=12), nullable=True), sa.Column('construction_year', sa.INTEGER(), nullable=True), - sa.Column('fuel_cost_per_mmbtu', sa.FLOAT(), nullable=True), - sa.Column('fuel_type', sa.TEXT(), nullable=True), - sa.Column('license_id_ferc1', sa.INTEGER(), nullable=True), + sa.Column('installation_year', sa.INTEGER(), nullable=True), sa.Column('net_generation_mwh', sa.FLOAT(), nullable=True), + sa.Column('not_water_limited_capacity_mw', sa.FLOAT(), nullable=True), + sa.Column('opex_allowances', sa.FLOAT(), nullable=True), + sa.Column('opex_boiler', sa.FLOAT(), nullable=True), + sa.Column('opex_coolants', sa.FLOAT(), nullable=True), + sa.Column('opex_electric', sa.FLOAT(), nullable=True), + sa.Column('opex_engineering', sa.FLOAT(), nullable=True), sa.Column('opex_fuel', sa.FLOAT(), nullable=True), - sa.Column('opex_maintenance', sa.FLOAT(), nullable=True), + sa.Column('fuel_cost_per_mwh', sa.FLOAT(), nullable=True), + sa.Column('opex_misc_power', sa.FLOAT(), nullable=True), + sa.Column('opex_misc_steam', sa.FLOAT(), nullable=True), + sa.Column('opex_nonfuel_per_mwh', sa.FLOAT(), nullable=True), sa.Column('opex_operations', sa.FLOAT(), nullable=True), - sa.Column('opex_total', sa.FLOAT(), nullable=True), + sa.Column('opex_per_mwh', sa.FLOAT(), nullable=True), + sa.Column('opex_plant', sa.FLOAT(), nullable=True), + sa.Column('opex_production_total', sa.FLOAT(), nullable=True), + sa.Column('opex_rents', sa.FLOAT(), nullable=True), + sa.Column('opex_steam', sa.FLOAT(), nullable=True), + sa.Column('opex_steam_other', sa.FLOAT(), nullable=True), + sa.Column('opex_structures', sa.FLOAT(), nullable=True), sa.Column('opex_total_nonfuel', sa.FLOAT(), nullable=True), + sa.Column('opex_transfer', sa.FLOAT(), nullable=True), sa.Column('peak_demand_mw', sa.FLOAT(), nullable=True), + sa.Column('plant_capability_mw', sa.FLOAT(), nullable=True), + sa.Column('plant_hours_connected_while_generating', sa.FLOAT(), nullable=True), sa.Column('plant_type', sa.TEXT(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_plants_small_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_small_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_small_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_small_ferc1') + sa.Column('record_id', sa.TEXT(), nullable=False), + sa.Column('water_limited_capacity_mw', sa.FLOAT(), nullable=True), + sa.Column('fuel_cost_per_mmbtu', sa.FLOAT(), nullable=True), + sa.Column('fuel_type', sa.TEXT(), nullable=True), + sa.Column('license_id_ferc1', sa.INTEGER(), nullable=True), + sa.Column('opex_maintenance', sa.FLOAT(), nullable=True), + sa.Column('opex_total', sa.FLOAT(), nullable=True), + sa.Column('capex_facilities', sa.FLOAT(), nullable=True), + sa.Column('capex_roads', sa.FLOAT(), nullable=True), + sa.Column('net_capacity_adverse_conditions_mw', sa.FLOAT(), nullable=True), + sa.Column('net_capacity_favorable_conditions_mw', sa.FLOAT(), nullable=True), + sa.Column('opex_dams', sa.FLOAT(), nullable=True), + sa.Column('opex_generation_misc', sa.FLOAT(), nullable=True), + sa.Column('opex_hydraulic', sa.FLOAT(), nullable=True), + sa.Column('opex_misc_plant', sa.FLOAT(), nullable=True), + sa.Column('opex_water_for_power', sa.FLOAT(), nullable=True), + sa.Column('ferc_license_id', sa.TEXT(), nullable=True), + sa.Column('capex_equipment_electric', sa.FLOAT(), nullable=True), + sa.Column('capex_equipment_misc', sa.FLOAT(), nullable=True), + sa.Column('capex_wheels_turbines_generators', sa.FLOAT(), nullable=True), + sa.Column('energy_used_for_pumping_mwh', sa.FLOAT(), nullable=True), + sa.Column('net_load_mwh', sa.FLOAT(), nullable=True), + sa.Column('opex_production_before_pumping', sa.FLOAT(), nullable=True), + sa.Column('opex_pumped_storage', sa.FLOAT(), nullable=True), + sa.Column('opex_pumping', sa.FLOAT(), nullable=True), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_plants_all_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_all_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_all_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_all_ferc1') + ) + op.create_table('denorm_purchased_power_ferc1', + sa.Column('report_year', sa.INTEGER(), nullable=True), + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('seller_name', sa.TEXT(), nullable=True), + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.Column('billing_demand_mw', sa.FLOAT(), nullable=True), + sa.Column('coincident_peak_demand_mw', sa.FLOAT(), nullable=True), + sa.Column('delivered_mwh', sa.FLOAT(), nullable=True), + sa.Column('demand_charges', sa.FLOAT(), nullable=True), + sa.Column('energy_charges', sa.FLOAT(), nullable=True), + sa.Column('non_coincident_peak_demand_mw', sa.FLOAT(), nullable=True), + sa.Column('other_charges', sa.FLOAT(), nullable=True), + sa.Column('purchase_type_code', sa.TEXT(), nullable=True), + sa.Column('purchased_mwh', sa.FLOAT(), nullable=True), + sa.Column('received_mwh', sa.FLOAT(), nullable=True), + sa.Column('tariff', sa.TEXT(), nullable=True), + sa.Column('total_settlement', sa.FLOAT(), nullable=True), + sa.ForeignKeyConstraint(['purchase_type_code'], ['core_ferc1__codes_power_purchase_types.code'], name='fk_denorm_purchased_power_ferc1_purchase_type_code_core_ferc1__codes_power_purchase_types'), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_purchased_power_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_purchased_power_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl') + ) + op.create_table('denorm_cash_flow_ferc1', + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('amount_type', sa.TEXT(), nullable=False), + sa.Column('amount', sa.FLOAT(), nullable=True), + sa.Column('balance', sa.TEXT(), nullable=True), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_cash_flow_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_cash_flow_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'amount_type', name='pk_denorm_cash_flow_ferc1') + ) + op.create_table('denorm_electric_operating_expenses_ferc1', + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('dollar_value', sa.FLOAT(), nullable=True), + sa.Column('expense_type', sa.TEXT(), nullable=False), + sa.Column('record_id', sa.TEXT(), nullable=True), + sa.Column('ferc_account', sa.TEXT(), nullable=True), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_operating_expenses_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_operating_expenses_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type', name='pk_denorm_electric_operating_expenses_ferc1') ) - op.create_table('denorm_plants_pumped_storage_ferc1', + op.create_table('denorm_plants_hydro_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=True), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), @@ -938,99 +1070,84 @@ def downgrade() -> None: sa.Column('avg_num_employees', sa.FLOAT(), nullable=True), sa.Column('capacity_factor', sa.FLOAT(), nullable=True), sa.Column('capacity_mw', sa.FLOAT(), nullable=True), - sa.Column('capex_equipment_electric', sa.FLOAT(), nullable=True), - sa.Column('capex_equipment_misc', sa.FLOAT(), nullable=True), + sa.Column('capex_equipment', sa.FLOAT(), nullable=True), sa.Column('capex_facilities', sa.FLOAT(), nullable=True), sa.Column('capex_land', sa.FLOAT(), nullable=True), sa.Column('capex_per_mw', sa.FLOAT(), nullable=True), sa.Column('capex_roads', sa.FLOAT(), nullable=True), sa.Column('capex_structures', sa.FLOAT(), nullable=True), sa.Column('capex_total', sa.FLOAT(), nullable=True), - sa.Column('capex_wheels_turbines_generators', sa.FLOAT(), nullable=True), sa.Column('construction_type', sa.VARCHAR(length=12), nullable=True), sa.Column('construction_year', sa.INTEGER(), nullable=True), - sa.Column('energy_used_for_pumping_mwh', sa.FLOAT(), nullable=True), sa.Column('installation_year', sa.INTEGER(), nullable=True), + sa.Column('net_capacity_adverse_conditions_mw', sa.FLOAT(), nullable=True), + sa.Column('net_capacity_favorable_conditions_mw', sa.FLOAT(), nullable=True), sa.Column('net_generation_mwh', sa.FLOAT(), nullable=True), - sa.Column('net_load_mwh', sa.FLOAT(), nullable=True), sa.Column('opex_dams', sa.FLOAT(), nullable=True), sa.Column('opex_electric', sa.FLOAT(), nullable=True), sa.Column('opex_engineering', sa.FLOAT(), nullable=True), sa.Column('opex_generation_misc', sa.FLOAT(), nullable=True), + sa.Column('opex_hydraulic', sa.FLOAT(), nullable=True), sa.Column('opex_misc_plant', sa.FLOAT(), nullable=True), sa.Column('opex_operations', sa.FLOAT(), nullable=True), sa.Column('opex_per_mwh', sa.FLOAT(), nullable=True), sa.Column('opex_plant', sa.FLOAT(), nullable=True), - sa.Column('opex_production_before_pumping', sa.FLOAT(), nullable=True), - sa.Column('opex_pumped_storage', sa.FLOAT(), nullable=True), - sa.Column('opex_pumping', sa.FLOAT(), nullable=True), sa.Column('opex_rents', sa.FLOAT(), nullable=True), sa.Column('opex_structures', sa.FLOAT(), nullable=True), sa.Column('opex_total', sa.FLOAT(), nullable=True), sa.Column('opex_total_nonfuel', sa.FLOAT(), nullable=True), sa.Column('opex_water_for_power', sa.FLOAT(), nullable=True), sa.Column('peak_demand_mw', sa.FLOAT(), nullable=True), - sa.Column('plant_capability_mw', sa.FLOAT(), nullable=True), sa.Column('plant_hours_connected_while_generating', sa.FLOAT(), nullable=True), sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('plant_type', sa.TEXT(), nullable=True), sa.Column('project_num', sa.INTEGER(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_plants_pumped_storage_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_pumped_storage_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_pumped_storage_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_pumped_storage_ferc1') + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_plants_hydro_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_hydro_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_hydro_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_hydro_ferc1') ) - op.create_table('denorm_purchased_power_ferc1', - sa.Column('report_year', sa.INTEGER(), nullable=True), + op.create_table('denorm_electricity_sales_by_rate_schedule_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('seller_name', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=True), + sa.Column('rate_schedule_type', sa.TEXT(), nullable=True), + sa.Column('billing_status', sa.TEXT(), nullable=True), + sa.Column('rate_schedule_description', sa.TEXT(), nullable=True), + sa.Column('sales_mwh', sa.FLOAT(), nullable=True), + sa.Column('dollar_value', sa.FLOAT(), nullable=True), + sa.Column('avg_customers_per_month', sa.FLOAT(), nullable=True), + sa.Column('kwh_per_customer', sa.FLOAT(), nullable=True), + sa.Column('revenue_per_kwh', sa.FLOAT(), nullable=True), sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('billing_demand_mw', sa.FLOAT(), nullable=True), - sa.Column('coincident_peak_demand_mw', sa.FLOAT(), nullable=True), - sa.Column('delivered_mwh', sa.FLOAT(), nullable=True), - sa.Column('demand_charges', sa.FLOAT(), nullable=True), - sa.Column('energy_charges', sa.FLOAT(), nullable=True), - sa.Column('non_coincident_peak_demand_mw', sa.FLOAT(), nullable=True), - sa.Column('other_charges', sa.FLOAT(), nullable=True), - sa.Column('purchase_type_code', sa.TEXT(), nullable=True), - sa.Column('purchased_mwh', sa.FLOAT(), nullable=True), - sa.Column('received_mwh', sa.FLOAT(), nullable=True), - sa.Column('tariff', sa.TEXT(), nullable=True), - sa.Column('total_settlement', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['purchase_type_code'], ['core_ferc1__codes_power_purchase_types.code'], name='fk_denorm_purchased_power_ferc1_purchase_type_code_core_ferc1__codes_power_purchase_types'), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_purchased_power_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_purchased_power_ferc1_utility_id_pudl_utilities_pudl') + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electricity_sales_by_rate_schedule_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_electricity_sales_by_rate_schedule_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl') ) - op.create_table('denorm_balance_sheet_liabilities_ferc1', + op.create_table('denorm_transmission_statistics_ferc1', sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('starting_balance', sa.FLOAT(), nullable=True), - sa.Column('ending_balance', sa.FLOAT(), nullable=True), - sa.Column('liability_type', sa.TEXT(), nullable=False), - sa.Column('balance', sa.TEXT(), nullable=True), - sa.Column('ferc_account', sa.TEXT(), nullable=True), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_balance_sheet_liabilities_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_balance_sheet_liabilities_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'liability_type', name='pk_denorm_balance_sheet_liabilities_ferc1') - ) - op.create_table('denorm_other_regulatory_liabilities_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('report_year', sa.INTEGER(), nullable=True), - sa.Column('description', sa.TEXT(), nullable=True), - sa.Column('ending_balance', sa.FLOAT(), nullable=True), - sa.Column('starting_balance', sa.FLOAT(), nullable=True), - sa.Column('increase_in_other_regulatory_liabilities', sa.FLOAT(), nullable=True), - sa.Column('account_detail', sa.TEXT(), nullable=True), - sa.Column('decrease_in_other_regulatory_liabilities', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_other_regulatory_liabilities_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_other_regulatory_liabilities_ferc1_utility_id_pudl_utilities_pudl') + sa.Column('start_point', sa.TEXT(), nullable=True), + sa.Column('end_point', sa.TEXT(), nullable=True), + sa.Column('operating_voltage_kv', sa.FLOAT(), nullable=True), + sa.Column('designed_voltage_kv', sa.FLOAT(), nullable=True), + sa.Column('supporting_structure_type', sa.TEXT(), nullable=True), + sa.Column('transmission_line_length_miles', sa.FLOAT(), nullable=True), + sa.Column('transmission_line_and_structures_length_miles', sa.FLOAT(), nullable=True), + sa.Column('num_transmission_circuits', sa.INTEGER(), nullable=True), + sa.Column('conductor_size_and_material', sa.TEXT(), nullable=True), + sa.Column('capex_land', sa.FLOAT(), nullable=True), + sa.Column('capex_other', sa.FLOAT(), nullable=True), + sa.Column('capex_total', sa.FLOAT(), nullable=True), + sa.Column('opex_operations', sa.FLOAT(), nullable=True), + sa.Column('opex_maintenance', sa.FLOAT(), nullable=True), + sa.Column('opex_rents', sa.FLOAT(), nullable=True), + sa.Column('opex_total', sa.FLOAT(), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_transmission_statistics_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_transmission_statistics_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl') ) op.create_table('denorm_utility_plant_summary_ferc1', sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), @@ -1043,23 +1160,39 @@ def downgrade() -> None: sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), sa.Column('ending_balance', sa.FLOAT(), nullable=True), sa.Column('record_id', sa.TEXT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_utility_plant_summary_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_utility_plant_summary_ferc1_utility_id_pudl_utilities_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_utility_plant_summary_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_utility_plant_summary_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'utility_plant_asset_type', name='pk_denorm_utility_plant_summary_ferc1') ) - op.create_table('denorm_depreciation_amortization_summary_ferc1', + op.create_table('denorm_other_regulatory_liabilities_ferc1', + sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), + sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), + sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=True), + sa.Column('description', sa.TEXT(), nullable=True), + sa.Column('ending_balance', sa.FLOAT(), nullable=True), + sa.Column('starting_balance', sa.FLOAT(), nullable=True), + sa.Column('increase_in_other_regulatory_liabilities', sa.FLOAT(), nullable=True), + sa.Column('account_detail', sa.TEXT(), nullable=True), + sa.Column('decrease_in_other_regulatory_liabilities', sa.FLOAT(), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_other_regulatory_liabilities_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_other_regulatory_liabilities_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl') + ) + op.create_table('denorm_income_statement_ferc1', sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('plant_function', sa.TEXT(), nullable=False), - sa.Column('ferc_account_label', sa.TEXT(), nullable=False), - sa.Column('ferc_account', sa.TEXT(), nullable=True), + sa.Column('report_year', sa.INTEGER(), nullable=False), + sa.Column('utility_type', sa.TEXT(), nullable=False), + sa.Column('income_type', sa.TEXT(), nullable=False), sa.Column('dollar_value', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_depreciation_amortization_summary_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_depreciation_amortization_summary_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'ferc_account_label', name='pk_denorm_depreciation_amortization_summary_ferc1') + sa.Column('balance', sa.TEXT(), nullable=True), + sa.Column('ferc_account', sa.TEXT(), nullable=True), + sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_income_statement_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_income_statement_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type', name='pk_denorm_income_statement_ferc1') ) op.create_table('denorm_plants_steam_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=True), @@ -1117,9 +1250,9 @@ def downgrade() -> None: sa.Column('plant_type', sa.TEXT(), nullable=True), sa.Column('record_id', sa.TEXT(), nullable=False), sa.Column('water_limited_capacity_mw', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_plants_steam_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_steam_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_steam_ferc1_utility_id_pudl_utilities_pudl'), + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_plants_steam_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_steam_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_steam_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_steam_ferc1') ) op.create_table('denorm_plant_in_service_ferc1', @@ -1137,170 +1270,37 @@ def downgrade() -> None: sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), sa.Column('starting_balance', sa.FLOAT(), nullable=True), sa.Column('transfers', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_plant_in_service_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plant_in_service_ferc1_utility_id_pudl_utilities_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1'], ['core_pudl__assn_utilities_ferc1.utility_id_ferc1'], name='fk_denorm_plant_in_service_ferc1_utility_id_ferc1_core_pudl__assn_utilities_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plant_in_service_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'ferc_account_label', name='pk_denorm_plant_in_service_ferc1') ) - op.create_table('denorm_electric_plant_depreciation_changes_ferc1', - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('depreciation_type', sa.TEXT(), nullable=False), - sa.Column('plant_status', sa.TEXT(), nullable=False), - sa.Column('utility_type', sa.TEXT(), nullable=False), - sa.Column('dollar_value', sa.FLOAT(), nullable=True), - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('balance', sa.TEXT(), nullable=True), - sa.Column('ferc_account', sa.TEXT(), nullable=True), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_plant_depreciation_changes_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_plant_depreciation_changes_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'depreciation_type', 'plant_status', 'utility_type', name='pk_denorm_electric_plant_depreciation_changes_ferc1') - ) - op.create_table('denorm_income_statement_ferc1', - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('utility_type', sa.TEXT(), nullable=False), - sa.Column('income_type', sa.TEXT(), nullable=False), - sa.Column('dollar_value', sa.FLOAT(), nullable=True), - sa.Column('balance', sa.TEXT(), nullable=True), - sa.Column('ferc_account', sa.TEXT(), nullable=True), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_income_statement_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_income_statement_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'utility_type', 'income_type', name='pk_denorm_income_statement_ferc1') - ) - op.create_table('denorm_electric_plant_depreciation_functional_ferc1', - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('plant_function', sa.TEXT(), nullable=False), - sa.Column('plant_status', sa.TEXT(), nullable=False), - sa.Column('utility_type', sa.TEXT(), nullable=False), - sa.Column('ending_balance', sa.FLOAT(), nullable=True), - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('balance', sa.TEXT(), nullable=True), - sa.Column('ferc_account', sa.TEXT(), nullable=True), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_plant_depreciation_functional_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_plant_depreciation_functional_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'plant_function', 'plant_status', 'utility_type', name='pk_denorm_electric_plant_depreciation_functional_ferc1') - ) - op.create_table('denorm_electric_operating_expenses_ferc1', - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('dollar_value', sa.FLOAT(), nullable=True), - sa.Column('expense_type', sa.TEXT(), nullable=False), - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.Column('ferc_account', sa.TEXT(), nullable=True), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_operating_expenses_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_operating_expenses_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'expense_type', name='pk_denorm_electric_operating_expenses_ferc1') - ) - op.create_table('denorm_plants_all_ferc1', + op.create_table('denorm_plants_small_ferc1', sa.Column('report_year', sa.INTEGER(), nullable=True), sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), sa.Column('plant_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('plant_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('plant_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('asset_retirement_cost', sa.FLOAT(), nullable=True), - sa.Column('avg_num_employees', sa.FLOAT(), nullable=True), - sa.Column('capacity_factor', sa.FLOAT(), nullable=True), + sa.Column('record_id', sa.TEXT(), nullable=False), sa.Column('capacity_mw', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_addition', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_addition_rolling', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_per_kw', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_per_mw', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_per_mw_rolling', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_per_mwh', sa.FLOAT(), nullable=True), - sa.Column('capex_annual_per_mwh_rolling', sa.FLOAT(), nullable=True), - sa.Column('capex_equipment', sa.FLOAT(), nullable=True), - sa.Column('capex_land', sa.FLOAT(), nullable=True), sa.Column('capex_per_mw', sa.FLOAT(), nullable=True), - sa.Column('capex_structures', sa.FLOAT(), nullable=True), sa.Column('capex_total', sa.FLOAT(), nullable=True), - sa.Column('capex_wo_retirement_total', sa.FLOAT(), nullable=True), - sa.Column('construction_type', sa.VARCHAR(length=12), nullable=True), sa.Column('construction_year', sa.INTEGER(), nullable=True), - sa.Column('installation_year', sa.INTEGER(), nullable=True), + sa.Column('fuel_cost_per_mmbtu', sa.FLOAT(), nullable=True), + sa.Column('fuel_type', sa.TEXT(), nullable=True), + sa.Column('license_id_ferc1', sa.INTEGER(), nullable=True), sa.Column('net_generation_mwh', sa.FLOAT(), nullable=True), - sa.Column('not_water_limited_capacity_mw', sa.FLOAT(), nullable=True), - sa.Column('opex_allowances', sa.FLOAT(), nullable=True), - sa.Column('opex_boiler', sa.FLOAT(), nullable=True), - sa.Column('opex_coolants', sa.FLOAT(), nullable=True), - sa.Column('opex_electric', sa.FLOAT(), nullable=True), - sa.Column('opex_engineering', sa.FLOAT(), nullable=True), sa.Column('opex_fuel', sa.FLOAT(), nullable=True), - sa.Column('fuel_cost_per_mwh', sa.FLOAT(), nullable=True), - sa.Column('opex_misc_power', sa.FLOAT(), nullable=True), - sa.Column('opex_misc_steam', sa.FLOAT(), nullable=True), - sa.Column('opex_nonfuel_per_mwh', sa.FLOAT(), nullable=True), + sa.Column('opex_maintenance', sa.FLOAT(), nullable=True), sa.Column('opex_operations', sa.FLOAT(), nullable=True), - sa.Column('opex_per_mwh', sa.FLOAT(), nullable=True), - sa.Column('opex_plant', sa.FLOAT(), nullable=True), - sa.Column('opex_production_total', sa.FLOAT(), nullable=True), - sa.Column('opex_rents', sa.FLOAT(), nullable=True), - sa.Column('opex_steam', sa.FLOAT(), nullable=True), - sa.Column('opex_steam_other', sa.FLOAT(), nullable=True), - sa.Column('opex_structures', sa.FLOAT(), nullable=True), + sa.Column('opex_total', sa.FLOAT(), nullable=True), sa.Column('opex_total_nonfuel', sa.FLOAT(), nullable=True), - sa.Column('opex_transfer', sa.FLOAT(), nullable=True), sa.Column('peak_demand_mw', sa.FLOAT(), nullable=True), - sa.Column('plant_capability_mw', sa.FLOAT(), nullable=True), - sa.Column('plant_hours_connected_while_generating', sa.FLOAT(), nullable=True), sa.Column('plant_type', sa.TEXT(), nullable=True), - sa.Column('record_id', sa.TEXT(), nullable=False), - sa.Column('water_limited_capacity_mw', sa.FLOAT(), nullable=True), - sa.Column('fuel_cost_per_mmbtu', sa.FLOAT(), nullable=True), - sa.Column('fuel_type', sa.TEXT(), nullable=True), - sa.Column('license_id_ferc1', sa.INTEGER(), nullable=True), - sa.Column('opex_maintenance', sa.FLOAT(), nullable=True), - sa.Column('opex_total', sa.FLOAT(), nullable=True), - sa.Column('capex_facilities', sa.FLOAT(), nullable=True), - sa.Column('capex_roads', sa.FLOAT(), nullable=True), - sa.Column('net_capacity_adverse_conditions_mw', sa.FLOAT(), nullable=True), - sa.Column('net_capacity_favorable_conditions_mw', sa.FLOAT(), nullable=True), - sa.Column('opex_dams', sa.FLOAT(), nullable=True), - sa.Column('opex_generation_misc', sa.FLOAT(), nullable=True), - sa.Column('opex_hydraulic', sa.FLOAT(), nullable=True), - sa.Column('opex_misc_plant', sa.FLOAT(), nullable=True), - sa.Column('opex_water_for_power', sa.FLOAT(), nullable=True), - sa.Column('ferc_license_id', sa.TEXT(), nullable=True), - sa.Column('capex_equipment_electric', sa.FLOAT(), nullable=True), - sa.Column('capex_equipment_misc', sa.FLOAT(), nullable=True), - sa.Column('capex_wheels_turbines_generators', sa.FLOAT(), nullable=True), - sa.Column('energy_used_for_pumping_mwh', sa.FLOAT(), nullable=True), - sa.Column('net_load_mwh', sa.FLOAT(), nullable=True), - sa.Column('opex_production_before_pumping', sa.FLOAT(), nullable=True), - sa.Column('opex_pumped_storage', sa.FLOAT(), nullable=True), - sa.Column('opex_pumping', sa.FLOAT(), nullable=True), - sa.ForeignKeyConstraint(['plant_id_pudl'], ['plants_pudl.plant_id_pudl'], name='fk_denorm_plants_all_ferc1_plant_id_pudl_plants_pudl'), - sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['plants_ferc1.utility_id_ferc1', 'plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_all_ferc1_utility_id_ferc1_plants_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_all_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_all_ferc1') - ) - op.create_table('denorm_electric_energy_dispositions_ferc1', - sa.Column('utility_id_ferc1', sa.INTEGER(), nullable=False), - sa.Column('utility_id_pudl', sa.INTEGER(), nullable=True), - sa.Column('utility_name_ferc1', sa.TEXT(), nullable=True), - sa.Column('report_year', sa.INTEGER(), nullable=False), - sa.Column('energy_disposition_type', sa.TEXT(), nullable=False), - sa.Column('row_type_xbrl', sa.VARCHAR(length=16), nullable=True), - sa.Column('energy_mwh', sa.FLOAT(), nullable=True), - sa.Column('record_id', sa.TEXT(), nullable=True), - sa.ForeignKeyConstraint(['utility_id_ferc1'], ['utilities_ferc1.utility_id_ferc1'], name='fk_denorm_electric_energy_dispositions_ferc1_utility_id_ferc1_utilities_ferc1'), - sa.ForeignKeyConstraint(['utility_id_pudl'], ['utilities_pudl.utility_id_pudl'], name='fk_denorm_electric_energy_dispositions_ferc1_utility_id_pudl_utilities_pudl'), - sa.PrimaryKeyConstraint('utility_id_ferc1', 'report_year', 'energy_disposition_type', name='pk_denorm_electric_energy_dispositions_ferc1') + sa.ForeignKeyConstraint(['plant_id_pudl'], ['core_pudl__entity_plants_pudl.plant_id_pudl'], name='fk_denorm_plants_small_ferc1_plant_id_pudl_core_pudl__entity_plants_pudl'), + sa.ForeignKeyConstraint(['utility_id_ferc1', 'plant_name_ferc1'], ['core_pudl__assn_plants_ferc1.utility_id_ferc1', 'core_pudl__assn_plants_ferc1.plant_name_ferc1'], name='fk_denorm_plants_small_ferc1_utility_id_ferc1_core_pudl__assn_plants_ferc1'), + sa.ForeignKeyConstraint(['utility_id_pudl'], ['core_pudl__entity_utilities_pudl.utility_id_pudl'], name='fk_denorm_plants_small_ferc1_utility_id_pudl_core_pudl__entity_utilities_pudl'), + sa.PrimaryKeyConstraint('record_id', name='pk_denorm_plants_small_ferc1') ) op.drop_table('out_ferc1__yearly_fuel_by_plant') op.drop_table('out_ferc1__yearly_fuel')