"""empty message

Revision ID: 5614f34b9d8b
Revises: c662f052956
Create Date: 2016-10-27 14:15:39.780688

"""

# revision identifiers, used by Alembic.
revision = '5614f34b9d8b'
down_revision = 'c662f052956'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()





def upgrade_():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def downgrade_():
    ### commands auto generated by Alembic - please adjust! ###
    pass
    ### end Alembic commands ###


def upgrade_stats():
    ### commands auto generated by Alembic - please adjust! ###
    import os
    if os.environ.get("SPLICE_IGNORE_REDSHIFT", "") == "true":
        return
    op.create_table('ss_event',
    sa.Column('client_id', sa.String(length=64), nullable=False),
    sa.Column('tab_id', sa.String(length=64), nullable=False),
    sa.Column('addon_version', sa.String(length=64), nullable=False),
    sa.Column('source', sa.String(length=64), nullable=False),
    sa.Column('session_id', sa.String(length=64), nullable=True),
    sa.Column('shield_variant', sa.String(length=64), nullable=True),
    sa.Column('page', sa.String(length=64), nullable=False),
    sa.Column('experiment_id', sa.String(length=64), nullable=True),
    sa.Column('action_position', sa.String(length=16), nullable=False),
    sa.Column('event', sa.String(length=16), nullable=False),
    sa.Column('recommendation_url', sa.String(length=255), nullable=True),
    sa.Column('recommender_type', sa.String(length=64), nullable=True),
    sa.Column('highlight_type', sa.String(length=64), nullable=True),
    sa.Column('share_provider', sa.String(length=64), nullable=True),
    sa.Column('metadata_source', sa.String(length=64), nullable=True),
    sa.Column('receive_at', sa.DateTime(), nullable=False),
    sa.Column('date', sa.Date(), nullable=False),
    sa.Column('locale', sa.String(length=14), nullable=False),
    sa.Column('country_code', sa.String(length=5), nullable=False),
    sa.Column('os', sa.String(length=64), nullable=False),
    sa.Column('browser', sa.String(length=64), nullable=False),
    sa.Column('version', sa.String(length=64), nullable=False),
    sa.Column('device', sa.String(length=64), nullable=False)
    )
    op.create_table('ss_performance',
    sa.Column('client_id', sa.String(length=64), nullable=False),
    sa.Column('tab_id', sa.String(length=64), nullable=False),
    sa.Column('addon_version', sa.String(length=64), nullable=False),
    sa.Column('source', sa.String(length=64), nullable=False),
    sa.Column('session_id', sa.String(length=64), nullable=True),
    sa.Column('shield_variant', sa.String(length=64), nullable=True),
    sa.Column('experiment_id', sa.String(length=64), nullable=True),
    sa.Column('event', sa.String(length=64), nullable=False),
    sa.Column('event_id', sa.String(length=64), nullable=False),
    sa.Column('metadata_source', sa.String(length=64), nullable=True),
    sa.Column('value', sa.Integer(), nullable=False),
    sa.Column('receive_at', sa.DateTime(), nullable=False),
    sa.Column('date', sa.Date(), nullable=False),
    sa.Column('locale', sa.String(length=14), nullable=False),
    sa.Column('country_code', sa.String(length=5), nullable=False),
    sa.Column('os', sa.String(length=64), nullable=False),
    sa.Column('browser', sa.String(length=64), nullable=False),
    sa.Column('version', sa.String(length=64), nullable=False),
    sa.Column('device', sa.String(length=64), nullable=False)
    )
    op.create_table('ss_session',
    sa.Column('client_id', sa.String(length=64), nullable=False),
    sa.Column('tab_id', sa.String(length=64), nullable=False),
    sa.Column('addon_version', sa.String(length=64), nullable=False),
    sa.Column('load_reason', sa.String(length=64), nullable=False),
    sa.Column('page', sa.String(length=64), nullable=False),
    sa.Column('unload_reason', sa.String(length=64), nullable=False),
    sa.Column('experiment_id', sa.String(length=64), nullable=True),
    sa.Column('max_scroll_depth', sa.Integer(), nullable=False),
    sa.Column('load_latency', sa.Integer(), nullable=False),
    sa.Column('total_bookmarks', sa.Integer(), nullable=False),
    sa.Column('total_history_size', sa.Integer(), nullable=False),
    sa.Column('session_duration', sa.Integer(), nullable=False),
    sa.Column('session_id', sa.String(length=64), nullable=True),
    sa.Column('shield_variant', sa.String(length=64), nullable=True),
    sa.Column('receive_at', sa.DateTime(), nullable=False),
    sa.Column('date', sa.Date(), nullable=False),
    sa.Column('locale', sa.String(length=14), nullable=False),
    sa.Column('country_code', sa.String(length=5), nullable=False),
    sa.Column('os', sa.String(length=64), nullable=False),
    sa.Column('browser', sa.String(length=64), nullable=False),
    sa.Column('version', sa.String(length=64), nullable=False),
    sa.Column('device', sa.String(length=64), nullable=False)
    )
    ### end Alembic commands ###


def downgrade_stats():
    ### commands auto generated by Alembic - please adjust! ###
    import os
    if os.environ.get("SPLICE_IGNORE_REDSHIFT", "") == "true":
        return
    op.drop_table('ss_session')
    op.drop_table('ss_performance')
    op.drop_table('ss_event')
    ### end Alembic commands ###

