3ffec872dfdf_add_a_description_to_api_token.py 585 B

1234567891011121314151617181920212223242526272829
  1. """Add a description to api token
  2. Revision ID: 3ffec872dfdf
  3. Revises: 770149d96e24
  4. Create Date: 2017-03-23 11:30:34.827399
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '3ffec872dfdf'
  8. down_revision = '770149d96e24'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. ''' Add the column description to the table tokens
  13. '''
  14. op.add_column(
  15. 'tokens',
  16. sa.Column('description', sa.Text, nullable=True)
  17. )
  18. def downgrade():
  19. ''' Drop the column description from the table tokens.
  20. '''
  21. op.drop_column('tokens', 'description')