mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
In order to support sending letters by first class we need a way to know how the service wants us to send the letter.
To start with this will be an attribute on the service, at the time the notification is created it will look at Service.letter_class to decide what class to use for the letter. This PR adds Service.letter class as a nullable column. Updated the create_service and update_service method to default the value to second. Subsequent PRs will add the check constraint to ensure we only get first or second in the letter_class column and make that column nullable. This can't be done all at once because it will cause an error if someone inserts or updates a service during the deploy.
This commit is contained in:
23
migrations/versions/0225_letter_class.py
Normal file
23
migrations/versions/0225_letter_class.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0225_letter_class
|
||||
Revises: 0224_returned_letter_status
|
||||
Create Date: 2018-09-13 16:23:59.168877
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = '0225_letter_class'
|
||||
down_revision = '0224_returned_letter_status'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('services', sa.Column('letter_class', sa.String(length=255), nullable=True))
|
||||
op.add_column('services_history', sa.Column('letter_class', sa.String(length=255), nullable=True))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('services_history', 'letter_class')
|
||||
op.drop_column('services', 'letter_class')
|
||||
Reference in New Issue
Block a user