"""added user id column

Revision ID: 9cad4dfb5125
Revises: 
Create Date: 2018-03-28 13:42:49.175195

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '9cad4dfb5125'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('PersonalGifCollections', sa.Column('user_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'PersonalGifCollections', 'Users', ['user_id'], ['id'])
    op.drop_constraint('Users_gif_collection_id_fkey', 'Users', type_='foreignkey')
    op.drop_column('Users', 'gif_collection_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('Users', sa.Column('gif_collection_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('Users_gif_collection_id_fkey', 'Users', 'PersonalGifCollections', ['gif_collection_id'], ['id'])
    op.drop_constraint(None, 'PersonalGifCollections', type_='foreignkey')
    op.drop_column('PersonalGifCollections', 'user_id')
    # ### end Alembic commands ###
