1
0

496f7a700f2e_add_priorities.py 832 B

12345678910111213141516171819202122232425262728293031323334353637
  1. """Add priorities
  2. Revision ID: 496f7a700f2e
  3. Revises: 4cae55a80a42
  4. Create Date: 2016-03-24 12:19:34.298752
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '496f7a700f2e'
  8. down_revision = '4cae55a80a42'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. ''' Add the column _priorities to the table projects
  13. and the column priority to the table issues.
  14. '''
  15. op.add_column(
  16. 'projects',
  17. sa.Column('_priorities', sa.Text, nullable=True)
  18. )
  19. op.add_column(
  20. 'issues',
  21. sa.Column('priority', sa.Integer, nullable=True, default=None)
  22. )
  23. def downgrade():
  24. ''' Drop the column _priorities from the table projects
  25. and the column priority from the table issues.
  26. '''
  27. op.drop_column('projects', '_priorities')
  28. op.drop_column('issues', 'priority')