"""empty message

Revision ID: 3f13f55d1da
Revises: 3d3bbaa94963
Create Date: 2015-06-28 12:25:17.170931

"""

# revision identifiers, used by Alembic.
revision = '3f13f55d1da'
down_revision = '3d3bbaa94963'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('posts', sa.Column('author_name_auto', sa.Integer(), nullable=True))
    op.add_column('posts', sa.Column('author_name_manual', sa.String(), nullable=True))
    op.drop_constraint(u'posts_author_id_auto_fkey', 'posts', type_='foreignkey')
    op.create_foreign_key(None, 'posts', 'users', ['author_name_auto'], ['id'])
    op.drop_column('posts', 'author_id_auto')
    op.drop_column('posts', 'author_id_manual')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('posts', sa.Column('author_id_manual', sa.VARCHAR(), autoincrement=False, nullable=True))
    op.add_column('posts', sa.Column('author_id_auto', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'posts', type_='foreignkey')
    op.create_foreign_key(u'posts_author_id_auto_fkey', 'posts', 'users', ['author_id_auto'], ['id'])
    op.drop_column('posts', 'author_name_manual')
    op.drop_column('posts', 'author_name_auto')
    ### end Alembic commands ###
