"""Add Use log

Revision ID: 17d2927a8743
Revises: 392aa82bba8f
Create Date: 2017-06-09 18:34:36.239300

"""

# revision identifiers, used by Alembic.
revision = '17d2927a8743'
down_revision = '392aa82bba8f'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('UseLogs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('datetime', sa.DateTime(), nullable=False),
    sa.Column('date', sa.Date(), nullable=False),
    sa.Column('day_of_week', sa.Integer(), nullable=False),
    sa.Column('hour_of_day', sa.Integer(), nullable=False),
    sa.Column('year', sa.Integer(), nullable=False),
    sa.Column('month', sa.Integer(), nullable=False),
    sa.Column('url', sa.Unicode(length=255), nullable=True),
    sa.Column('ip_address', sa.Unicode(length=100), nullable=True),
    sa.Column('web_browser', sa.Unicode(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(u'ix_UseLogs_date', 'UseLogs', ['date'], unique=False)
    op.create_index(u'ix_UseLogs_datetime', 'UseLogs', ['datetime'], unique=False)
    op.create_index(u'ix_UseLogs_day_of_week', 'UseLogs', ['day_of_week'], unique=False)
    op.create_index(u'ix_UseLogs_hour_of_day', 'UseLogs', ['hour_of_day'], unique=False)
    op.create_index(u'ix_UseLogs_ip_address', 'UseLogs', ['ip_address'], unique=False)
    op.create_index(u'ix_UseLogs_month', 'UseLogs', ['month'], unique=False)
    op.create_index(u'ix_UseLogs_url', 'UseLogs', ['url'], unique=False)
    op.create_index(u'ix_UseLogs_web_browser', 'UseLogs', ['web_browser'], unique=False)
    op.create_index(u'ix_UseLogs_year', 'UseLogs', ['year'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(u'ix_UseLogs_year', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_web_browser', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_url', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_month', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_ip_address', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_hour_of_day', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_day_of_week', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_datetime', table_name='UseLogs')
    op.drop_index(u'ix_UseLogs_date', table_name='UseLogs')
    op.drop_table('UseLogs')
    ### end Alembic commands ###
