"""behaviors

Revision: 0020
Revision ID: 51ef836d17f
Revises: 74bc667256f
Create Date: 2015-08-31 15:30:37.277910

"""

# revision identifiers, used by Alembic.
revision = '51ef836d17f'
down_revision = '74bc667256f'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('card_behaviors', sa.Column('activated_at', sa.DateTime(), nullable=True))
    op.add_column('card_behaviors', sa.Column('activated_by_id', sa.Integer(), nullable=True))
    op.add_column('card_behaviors', sa.Column('enabled', sa.Boolean(), nullable=True))
    op.add_column('card_behaviors', sa.Column('meta', postgresql.JSON(), nullable=True))
    op.add_column('card_behaviors', sa.Column('needs_reactivation', sa.Boolean(), nullable=True))
    op.create_foreign_key(None, 'card_behaviors', 'users', ['activated_by_id'], ['id'])
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'card_behaviors', type_='foreignkey')
    op.drop_column('card_behaviors', 'needs_reactivation')
    op.drop_column('card_behaviors', 'meta')
    op.drop_column('card_behaviors', 'enabled')
    op.drop_column('card_behaviors', 'activated_by_id')
    op.drop_column('card_behaviors', 'activated_at')
    ### end Alembic commands ###
