This commit is contained in:
Kenneth Kehl
2023-08-29 14:54:30 -07:00
parent 19dcd7a48b
commit 1ecb747c6d
588 changed files with 34091 additions and 23580 deletions
+13 -10
View File
@@ -7,27 +7,30 @@ Create Date: 2016-04-25 14:16:49.787229
"""
# revision identifiers, used by Alembic.
revision = '0008_archive_template'
down_revision = '0007_template_history'
revision = "0008_archive_template"
down_revision = "0007_template_history"
from alembic import op
import sqlalchemy as sa
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.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)
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')
op.drop_column("templates_history", "archived")
op.drop_column("templates", "archived")
### end Alembic commands ###