"""create dropbox log table

Revision ID: 2ea125c04ba1
Revises: 648705e80aa
Create Date: 2014-03-23 14:07:00.529804

"""

# revision identifiers, used by Alembic.
revision = '2ea125c04ba1'
down_revision = '648705e80aa'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('dropbox_log',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('category', sa.Enum('stream', 'today'), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('target_id', sa.Integer(), nullable=True),
    sa.Column('status', sa.Enum('success', 'failed'), nullable=False),
    sa.Column('create_at', sa.DateTime(), nullable=True),
    sa.Column('update_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_dropbox_log_target_id', 'dropbox_log', ['target_id'], unique=False)
    op.create_index('ix_dropbox_log_user_id', 'dropbox_log', ['user_id'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_dropbox_log_user_id', table_name='dropbox_log')
    op.drop_index('ix_dropbox_log_target_id', table_name='dropbox_log')
    op.drop_table('dropbox_log')
    ### end Alembic commands ###
