Blame alembic/versions/3ffec872dfdf_add_a_description_to_api_token.py

Pierre-Yves Chibon 60a786
"""Add a description to api token
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
Revision ID: 3ffec872dfdf
Pierre-Yves Chibon 60a786
Revises: 770149d96e24
Pierre-Yves Chibon 60a786
Create Date: 2017-03-23 11:30:34.827399
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
"""
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
# revision identifiers, used by Alembic.
Pierre-Yves Chibon 60a786
revision = '3ffec872dfdf'
Pierre-Yves Chibon 60a786
down_revision = '770149d96e24'
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
from alembic import op
Pierre-Yves Chibon 60a786
import sqlalchemy as sa
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
def upgrade():
Pierre-Yves Chibon 60a786
    ''' Add the column description to the table tokens
Pierre-Yves Chibon 60a786
    '''
Pierre-Yves Chibon 60a786
    op.add_column(
Pierre-Yves Chibon 60a786
        'tokens',
Pierre-Yves Chibon 60a786
        sa.Column('description', sa.Text, nullable=True)
Pierre-Yves Chibon 60a786
    )
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
Pierre-Yves Chibon 60a786
def downgrade():
Pierre-Yves Chibon 60a786
    ''' Drop the column description from the table tokens.
Pierre-Yves Chibon 60a786
    '''
Pierre-Yves Chibon 60a786
    op.drop_column('tokens', 'description')