Blame alembic/versions/2aa7b3958bc5_add_the_milestones_column.py

Pierre-Yves Chibon 6667f6
"""Add the milestones column
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
Revision ID: 2aa7b3958bc5
Pierre-Yves Chibon 6667f6
Revises: 443e090da188
Pierre-Yves Chibon 6667f6
Create Date: 2016-05-03 15:59:04.992414
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
"""
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
# revision identifiers, used by Alembic.
Pierre-Yves Chibon 6667f6
revision = '2aa7b3958bc5'
Pierre-Yves Chibon 6667f6
down_revision = '443e090da188'
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
from alembic import op
Pierre-Yves Chibon 6667f6
import sqlalchemy as sa
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
def upgrade():
Pierre-Yves Chibon 6667f6
    ''' Add the column _milestones to the table projects
Pierre-Yves Chibon 6667f6
    and the column milestone to the table issues.
Pierre-Yves Chibon 6667f6
    '''
Pierre-Yves Chibon 6667f6
    op.add_column(
Pierre-Yves Chibon 6667f6
        'projects',
Pierre-Yves Chibon 6667f6
        sa.Column('_milestones', sa.Text, nullable=True)
Pierre-Yves Chibon 6667f6
    )
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
Pierre-Yves Chibon 6667f6
def downgrade():
Pierre-Yves Chibon 6667f6
    ''' Drop the column _milestones from the table projects
Pierre-Yves Chibon 6667f6
    and the column milestone from the table issues.
Pierre-Yves Chibon 6667f6
    '''
Pierre-Yves Chibon 6667f6
    op.drop_column('projects', '_milestones')