Add "total amount" to CLINS

- includes migration for change to model
This commit is contained in:
graham-dds
2019-09-05 15:09:20 -04:00
parent e565913f48
commit f3eea39536
5 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"""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 ###