mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 01:56:03 -04:00
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.
This commit is contained in:
23
migrations/versions/0016_add_email_from.py
Normal file
23
migrations/versions/0016_add_email_from.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0016_add_email_from
|
||||
Revises: 0015_add_subject_line
|
||||
Create Date: 2016-02-18 11:25:37.915137
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0016_add_email_from'
|
||||
down_revision = '0015_add_subject_line'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('services', sa.Column('email_from', sa.Text(), nullable=True))
|
||||
op.execute("UPDATE services SET email_from=name")
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('services', 'email_from')
|
||||
Reference in New Issue
Block a user