"""parent child relation in Versions

Revision ID: 53d8127d8560
Revises: 4a836cf73bcf
Create Date: 2013-05-22 12:44:05.626047

"""

# revision identifiers, used by Alembic.
revision = '53d8127d8560'
down_revision = '4a836cf73bcf'

from alembic import op
import sqlalchemy as sa


def upgrade():
    try:
        op.add_column(
            'Versions',
            sa.Column('parent_id', sa.Integer(), nullable=True)
        )
    except (sa.exc.OperationalError, sa.exc.InternalError):
        pass


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('Versions', 'parent_id')
    ### end Alembic commands ###
