Add postage column to ft_billing

Added a new varchar column, postage, to ft_billing. This is nullable and
not part of the composite primary key for now, but this will change
later.
This commit is contained in:
Katie Smith
2018-09-24 14:58:59 +01:00
parent 48db3a5e11
commit 0936060f5d
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
"""
Revision ID: 0234_ft_billing_postage
Revises: 0233_updated_first_class_dates
Create Date: 2018-09-28 14:43:26.100884
"""
from alembic import op
import sqlalchemy as sa
revision = '0234_ft_billing_postage'
down_revision = '0233_updated_first_class_dates'
def upgrade():
op.add_column('ft_billing', sa.Column('postage', sa.String(), nullable=True))
op.execute("UPDATE ft_billing SET postage = (CASE WHEN notification_type = 'letter' THEN 'second' ELSE 'none' END)")
def downgrade():
op.drop_column('ft_billing', 'postage')