"""add created_at and username to warbler model

Revision ID: 280e7687ca87
Revises: 6a4752f902fa
Create Date: 2017-10-26 16:16:20.518128

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '280e7687ca87'
down_revision = '6a4752f902fa'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('warblers', sa.Column('created_at', sa.DateTime(), nullable=True))
    op.add_column('warblers', sa.Column('username', sa.Text(), nullable=True))
    op.create_foreign_key(None, 'warblers', 'users', ['username'], ['username'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'warblers', type_='foreignkey')
    op.drop_column('warblers', 'username')
    op.drop_column('warblers', 'created_at')
    # ### end Alembic commands ###
