22db0a833d35_add_notifications_to_tickets.py 821 B

123456789101112131415161718192021222324252627282930313233
  1. """Add notifications to tickets
  2. Revision ID: 22db0a833d35
  3. Revises: 317a285e04a8
  4. Create Date: 2016-06-27 16:10:33.395495
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '22db0a833d35'
  8. down_revision = '317a285e04a8'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. ''' Add the column notification to the table issue_comments.
  13. '''
  14. op.add_column(
  15. 'issue_comments',
  16. sa.Column('notification', sa.Boolean, default=False, nullable=True)
  17. )
  18. op.execute('''UPDATE "issue_comments" SET notification=False;''')
  19. op.alter_column(
  20. 'issue_comments', 'notification',
  21. nullable=False, existing_nullable=True)
  22. def downgrade():
  23. ''' Remove the column notification from the table issue_comments.
  24. '''
  25. op.drop_column('issue_comments', 'notification')