mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Added functionality to archive a template.
Renamed migration file.
This commit is contained in:
33
migrations/versions/0008_archive_template.py
Normal file
33
migrations/versions/0008_archive_template.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""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'
|
||||
|
||||
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.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 ###
|
||||
Reference in New Issue
Block a user