349a3890596_increase_length_group_name.py 732 B

12345678910111213141516171819202122232425262728293031323334
  1. """Increase length group name
  2. Revision ID: 349a3890596
  3. Revises: 5083efccac7
  4. Create Date: 2016-11-30 14:30:15.681269
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '349a3890596'
  8. down_revision = '114d3a68c1fd'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. ''' Increase the length of group_name to 255 characters instead of 16.
  13. '''
  14. op.alter_column(
  15. 'pagure_group', 'group_name',
  16. type_=sa.String(255),
  17. existing_type=sa.String(16)
  18. )
  19. def downgrade():
  20. ''' Decrease the length of group_name to 16 characters instead of 255.
  21. '''
  22. op.alter_column(
  23. 'pagure_group', 'group_name',
  24. type_=sa.String(16),
  25. existing_type=sa.String(255)
  26. )