"""empty message

Revision ID: 1284b4e50dbf
Revises: 4e3760d862ee
Create Date: 2019-07-21 18:36:42.439937

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '1284b4e50dbf'
down_revision = '4e3760d862ee'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('fetch_records',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('add_time', sa.Time(), nullable=True),
    sa.Column('update_time', sa.Time(), nullable=True),
    sa.Column('domain_id', sa.Integer(), nullable=False),
    sa.Column('title', sa.Text(), nullable=True),
    sa.Column('headers', sa.Text(), nullable=True),
    sa.Column('body', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['domain_id'], ['domains.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('domains', sa.Column('add_time', sa.Time(), nullable=True))
    op.add_column('domains', sa.Column('update_time', sa.Time(), nullable=True))
    op.add_column('roles', sa.Column('add_time', sa.Time(), nullable=True))
    op.add_column('roles', sa.Column('update_time', sa.Time(), nullable=True))
    op.add_column('users', sa.Column('add_time', sa.Time(), nullable=True))
    op.add_column('users', sa.Column('update_time', sa.Time(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('users', 'update_time')
    op.drop_column('users', 'add_time')
    op.drop_column('roles', 'update_time')
    op.drop_column('roles', 'add_time')
    op.drop_column('domains', 'update_time')
    op.drop_column('domains', 'add_time')
    op.drop_table('fetch_records')
    # ### end Alembic commands ###
