"""empty message

Revision ID: dd6f43a2bd2d
Revises: b82813d20f81
Create Date: 2020-01-13 14:49:09.996783

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "dd6f43a2bd2d"
down_revision = "b82813d20f81"
branch_labels = None
depends_on = None

columns_list = [
    ("orders", "limit"),
    ("orders", "consumed"),
    ("order_logs", "limit"),
    ("order_logs", "consumed"),
    ("order_logs", "amount"),
    ("product_rules_versions", "min_budget"),
]

old_type = sa.Numeric(precision=18, scale=4)
new_type = sa.Numeric(precision=20, scale=6)


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    for table, column in columns_list:
        op.alter_column(table, column, type_=new_type)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    for table, column in columns_list:
        op.alter_column(table, column, type_=old_type)
    # ### end Alembic commands ###
