"""followers

Revision ID: 090b913f3004
Revises: f3a0dd2117e9
Create Date: 2019-01-15 11:24:57.721531

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '090b913f3004'
down_revision = 'f3a0dd2117e9'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('followers',
    sa.Column('follower_id', sa.Integer(), nullable=True),
    sa.Column('followed_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['followed_id'], ['user.id'], ),
    sa.ForeignKeyConstraint(['follower_id'], ['user.id'], )
    )
    op.add_column('search', sa.Column('timestamp', sa.DateTime(), nullable=True))
    op.create_index(op.f('ix_search_timestamp'), 'search', ['timestamp'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_search_timestamp'), table_name='search')
    op.drop_column('search', 'timestamp')
    op.drop_table('followers')
    # ### end Alembic commands ###
