Files
notifications-api/migrations/versions/0015_add_subject_line.py
Martyn Inglis f8ac14ea30 Update model
- adds email_from field to the service model
- adds subject_line to the template model

These are unique and not null fields, so there is a migration here for email_from to populate it.
2016-02-19 15:52:19 +00:00

27 lines
590 B
Python

"""empty message
Revision ID: 0015_add_subject_line
Revises: 0014_job_id_nullable
Create Date: 2016-02-18 09:43:29.282804
"""
# revision identifiers, used by Alembic.
revision = '0015_add_subject_line'
down_revision = '0014_job_id_nullable'
from alembic import op
import sqlalchemy as sa
def upgrade():
pass
op.add_column('templates', sa.Column('subject', sa.Text(), nullable=True))
op.create_unique_constraint(None, 'templates', ['subject'])
def downgrade():
pass
op.drop_constraint(None, 'templates', type_='unique')
op.drop_column('templates', 'subject')