mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 23:02:13 -05:00
Since the application code gets released after the migration setting a new Template field as non-nullable prevents new templates from being created by the existing application instances. This splits the migration to set fields as nullable first and then update existing records once the application code has been released. 0168 is modified not to run UPDATE query or set non-nullable flag in staging and production. 0169 is added to rollback preview.
24 lines
560 B
Python
24 lines
560 B
Python
"""
|
|
|
|
Revision ID: 0168_hidden_templates
|
|
Revises: 0167_add_precomp_letter_svc_perm
|
|
Create Date: 2018-02-21 14:05:04.448977
|
|
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = '0168_hidden_templates'
|
|
down_revision = '0167_add_precomp_letter_svc_perm'
|
|
|
|
|
|
def upgrade():
|
|
op.add_column('templates', sa.Column('hidden', sa.Boolean(), nullable=True))
|
|
op.add_column('templates_history', sa.Column('hidden', sa.Boolean(), nullable=True))
|
|
|
|
|
|
def downgrade():
|
|
op.drop_column('templates_history', 'hidden')
|
|
op.drop_column('templates', 'hidden')
|