Files
notifications-api/migrations/versions/0008_archive_template.py
T

37 lines
1.1 KiB
Python
Raw Normal View History

2016-04-25 16:28:08 +01:00
"""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.
2023-08-29 14:54:30 -07:00
revision = "0008_archive_template"
down_revision = "0007_template_history"
2016-04-25 16:28:08 +01:00
import sqlalchemy as sa
2023-12-08 21:43:52 -05:00
from alembic import op
2016-04-25 16:28:08 +01:00
from sqlalchemy.dialects import postgresql
2023-08-29 14:54:30 -07:00
2016-04-25 16:28:08 +01:00
def upgrade():
### commands auto generated by Alembic - please adjust! ###
2023-08-29 14:54:30 -07:00
op.add_column("templates", sa.Column("archived", sa.Boolean(), nullable=True))
op.add_column(
"templates_history", sa.Column("archived", sa.Boolean(), nullable=True)
)
2016-04-25 16:28:08 +01:00
op.get_bind()
2023-08-29 14:54:30 -07:00
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)
2016-04-25 16:28:08 +01:00
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
2023-08-29 14:54:30 -07:00
op.drop_column("templates_history", "archived")
op.drop_column("templates", "archived")
2016-04-25 16:28:08 +01:00
### end Alembic commands ###