Skip to content

Commit

Permalink
Alocate changes file to versions folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ilinardic22 committed Nov 29, 2023
1 parent 3072035 commit 0731fb4
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ def upgrade() -> None:
op.alter_column('order_details', 'total_price', type_=sa.Integer)


# def downgrade() -> None:
# op.alter_column(
# 'order_details',
# 'vendor_id',
# nullable=False,
# )

# # Alter the column type back to Numeric
# op.alter_column('order_details', 'unit_price', type_=sa.Numeric(10, 2))
# op.alter_column('order_details', 'total_price', type_=sa.Numeric(10, 2))

# # Convert integer values back to their decimal representations
# op.execute('UPDATE order_details SET unit_price = total_price / 100.0')
# op.execute('UPDATE order_details SET total_price = total_price / 100.0')
def downgrade() -> None:
op.alter_column(
'order_details',
'vendor_id',
nullable=False,
)

# Alter the column type back to Numeric
op.alter_column('order_details', 'unit_price', type_=sa.Numeric(10, 2))
op.alter_column('order_details', 'total_price', type_=sa.Numeric(10, 2))

# Convert integer values back to their decimal representations
op.execute('UPDATE order_details SET unit_price = total_price / 100.0')
op.execute('UPDATE order_details SET total_price = total_price / 100.0')

0 comments on commit 0731fb4

Please sign in to comment.