Skip to content

Commit

Permalink
adding caasting of values to change type
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanda Eames authored and Amanda Eames committed May 22, 2024
1 parent 00bc340 commit d095205
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@
def upgrade() -> None:
op.alter_column('country_code', 'activity_value',
existing_type=sa.String(),
type_=sa.Float)
type_=sa.Float(),
postgresql_using='activity_value::double precision')
op.alter_column('country_code', 'emissions_value',
existing_type=sa.String(),
type_=sa.Float)

type_=sa.Float(),
postgresql_using='emissions_value::double precision')

def downgrade() -> None:
op.alter_column('country_code', 'activity_value',
existing_type=sa.Float,
type_=sa.String())
existing_type=sa.Float(),
type_=sa.String(),
postgresql_using='activity_value::text')
op.alter_column('country_code', 'emissions_value',
existing_type=sa.Float,
type_=sa.String())
existing_type=sa.Float(),
type_=sa.String(),
postgresql_using='emissions_value::text')

0 comments on commit d095205

Please sign in to comment.