mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-10 12:41:00 -05:00
Merge pull request #1706 from alphagov/nullable-template-hidden
Set Template.hidden as nullable before the new app code gets released
This commit is contained in:
@@ -17,12 +17,6 @@ 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))
|
||||
|
||||
op.execute('UPDATE templates SET hidden=false')
|
||||
op.execute('UPDATE templates_history SET hidden=false')
|
||||
|
||||
op.alter_column('templates', 'hidden', nullable=False)
|
||||
op.alter_column('templates_history', 'hidden', nullable=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column('templates_history', 'hidden')
|
||||
|
||||
22
migrations/versions/0169_hidden_templates_nullable.py
Normal file
22
migrations/versions/0169_hidden_templates_nullable.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0169_hidden_templates_nullable
|
||||
Revises: 0168_hidden_templates
|
||||
Create Date: 2018-02-21 14:05:04.448977
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
|
||||
revision = '0169_hidden_templates_nullable'
|
||||
down_revision = '0168_hidden_templates'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.alter_column('templates', 'hidden', nullable=True)
|
||||
op.alter_column('templates_history', 'hidden', nullable=True)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.alter_column('templates', 'hidden', nullable=False)
|
||||
op.alter_column('templates_history', 'hidden', nullable=False)
|
||||
Reference in New Issue
Block a user