"""Add total amount to CLINs

Revision ID: f03333c42bdb
Revises: 4a3122ffe898
Create Date: 2019-09-04 15:35:39.446486

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f03333c42bdb' # pragma: allowlist secret
down_revision = '30ea1cb20807' # pragma: allowlist secret
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('clins', sa.Column('total_amount', sa.Numeric(scale=2), nullable=True))
    op.execute("UPDATE clins SET total_amount = 0")
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('clins', 'total_amount')
    # ### end Alembic commands ###
