Files
notifications-api/migrations/versions/0008_archive_template.py
Cliff Hill 1157f5639d black, isort, flake8
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2023-12-08 21:43:52 -05:00

37 lines
1.1 KiB
Python

"""empty message
Revision ID: 0008_archive_template
Revises: 0007_template_history
Create Date: 2016-04-25 14:16:49.787229
"""
# revision identifiers, used by Alembic.
revision = "0008_archive_template"
down_revision = "0007_template_history"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column("templates", sa.Column("archived", sa.Boolean(), nullable=True))
op.add_column(
"templates_history", sa.Column("archived", sa.Boolean(), nullable=True)
)
op.get_bind()
op.execute("UPDATE templates SET archived = FALSE")
op.execute("UPDATE templates_history set archived = FALSE")
op.alter_column("templates", "archived", nullable=False)
op.alter_column("templates", "archived", nullable=False)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column("templates_history", "archived")
op.drop_column("templates", "archived")
### end Alembic commands ###