-
-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename
heat_rate_mmbtu_mwh -> heat_rate_mmbtu_mwh_by_unit
(#2917)
* Rename heat_rate_mmbtu_mwh -> heat_rate_mmbtu_mwh_by_unit * Rename heat rate mmbtu mwh to follow existing naming convention
- Loading branch information
1 parent
799282a
commit 4260c2e
Showing
11 changed files
with
280 additions
and
35 deletions.
There are no files selected for viewing
121 changes: 121 additions & 0 deletions
121
migrations/versions/1e4356aa41cf_rename_heat_rate_column_to_follow_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
"""Rename heat rate column to follow column naming convention | ||
Revision ID: 1e4356aa41cf | ||
Revises: c415b55c4dcf | ||
Create Date: 2023-10-04 20:00:29.217602 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1e4356aa41cf' | ||
down_revision = 'c415b55c4dcf' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('_out_eia__monthly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__monthly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__plant_parts', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__yearly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__yearly_generators_by_ownership', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('unit_heat_rate_mmbtu_per_mwh', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('out_eia__yearly_generators_by_ownership', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('out_eia__yearly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('out_eia__plant_parts', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('out_eia__monthly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('unit_heat_rate_mmbtu_per_mwh') | ||
|
||
# ### end Alembic commands ### |
121 changes: 121 additions & 0 deletions
121
migrations/versions/c415b55c4dcf_rename_heat_rate_mmbtu_mwh_to_heat_rate_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
"""Rename heat_rate_mmbtu_mwh to heat_rate_mmbtu_mwh_by_unit | ||
Revision ID: c415b55c4dcf | ||
Revises: ab0540a6484c | ||
Create Date: 2023-10-04 08:08:23.744433 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'c415b55c4dcf' | ||
down_revision = 'ab0540a6484c' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('_out_eia__monthly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('out_eia__monthly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('out_eia__plant_parts', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('out_eia__yearly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
with op.batch_alter_table('out_eia__yearly_generators_by_ownership', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh_by_unit', sa.Float(), nullable=True, comment='Fuel content per unit of electricity generated. Coming from MCOE calculation.')) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh') | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table('out_eia__yearly_generators_by_ownership', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__yearly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__plant_parts', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('out_eia__monthly_generators', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__yearly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_unit', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_heat_rate_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_fuel_cost_by_generator', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
with op.batch_alter_table('_out_eia__monthly_derived_generator_attributes', schema=None) as batch_op: | ||
batch_op.add_column(sa.Column('heat_rate_mmbtu_mwh', sa.FLOAT(), nullable=True)) | ||
batch_op.drop_column('heat_rate_mmbtu_mwh_by_unit') | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.