Files
notifications-api/migrations/versions/0170_hidden_non_nullable.py

26 lines
681 B
Python
Raw Normal View History

"""
Revision ID: 0170_hidden_non_nullable
Revises: 0169_hidden_templates_nullable
Create Date: 2018-02-21 14:05:04.448977
"""
2024-04-01 15:12:33 -07:00
from alembic import op
2023-08-29 14:54:30 -07:00
revision = "0170_hidden_non_nullable"
down_revision = "0169_hidden_templates_nullable"
def upgrade():
2023-08-29 14:54:30 -07:00
op.execute("UPDATE templates SET hidden=false WHERE hidden is NULL")
op.execute("UPDATE templates_history SET hidden=false WHERE hidden is NULL")
2023-08-29 14:54:30 -07:00
op.alter_column("templates", "hidden", nullable=False)
op.alter_column("templates_history", "hidden", nullable=False)
def downgrade():
2023-08-29 14:54:30 -07:00
op.alter_column("templates", "hidden", nullable=True)
op.alter_column("templates_history", "hidden", nullable=True)