Blame alembic/versions/5993f9240bcf_allow_mirroring_project_in.py

Pierre-Yves Chibon 227f4c
"""Allow mirroring project in
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
Revision ID: 5993f9240bcf
Pierre-Yves Chibon 227f4c
Revises: 1f24c9c8efa5
Pierre-Yves Chibon 227f4c
Create Date: 2018-12-14 10:00:05.281979
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
"""
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
from alembic import op
Pierre-Yves Chibon 227f4c
import sqlalchemy as sa
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
# revision identifiers, used by Alembic.
Pierre-Yves Chibon 227f4c
revision = '5993f9240bcf'
Pierre-Yves Chibon 227f4c
down_revision = '1f24c9c8efa5'
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
def upgrade():
Pierre-Yves Chibon 227f4c
    ''' Add the column mirrored_from to the table projects.
Pierre-Yves Chibon 227f4c
    '''
Pierre-Yves Chibon 227f4c
    op.add_column(
Pierre-Yves Chibon 227f4c
        'projects',
Pierre-Yves Chibon 227f4c
        sa.Column('mirrored_from', sa.Text, nullable=True)
Pierre-Yves Chibon 227f4c
    )
Pierre-Yves Chibon 227f4c
    op.add_column(
Pierre-Yves Chibon 227f4c
        'projects',
Pierre-Yves Chibon 227f4c
        sa.Column('mirrored_from_last_log', sa.Text, nullable=True)
Pierre-Yves Chibon 227f4c
    )
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
Pierre-Yves Chibon 227f4c
def downgrade():
Pierre-Yves Chibon 227f4c
    ''' Remove the column mirrored_from from the table projects.
Pierre-Yves Chibon 227f4c
    '''
Pierre-Yves Chibon 227f4c
    op.drop_column('projects', 'mirrored_from')
Pierre-Yves Chibon 227f4c
    op.drop_column('projects', 'mirrored_from_last_log')