"""Removed Email and EmailEvent from model.

Revision ID: 1c3642736709
Revises: 8ce5e5684e57
Create Date: 2016-08-22 21:10:10.398600

"""

# revision identifiers, used by Alembic.
revision = '1c3642736709'
down_revision = '8ce5e5684e57'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('emailevents')
    op.drop_table('emails')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('emails',
    sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('emails_id_seq'::regclass)"), nullable=False),
    sa.Column('message', postgresql.JSON(), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='emails_pkey'),
    postgresql_ignore_search_path=False
    )
    op.create_table('emailevents',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('status', sa.VARCHAR(length=20), autoincrement=False, nullable=True),
    sa.Column('data', postgresql.JSON(), autoincrement=False, nullable=True),
    sa.Column('email_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['email_id'], ['emails.id'], name='emailevents_email_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='emailevents_pkey')
    )
    ### end Alembic commands ###
