"""empty message

Revision ID: f1531223b9e5
Revises: ec7d4c35740b
Create Date: 2016-07-24 14:54:30.631000

"""

# revision identifiers, used by Alembic.
revision = 'f1531223b9e5'
down_revision = 'ec7d4c35740b'

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('events', sa.Column('has_session_speakers', sa.Boolean(), nullable=True, default=False))
    op.add_column('events_version', sa.Column('has_session_speakers', sa.Boolean(), autoincrement=False, nullable=True))
    op.execute("UPDATE session SET timezone = 'UTC' WHERE timezone IS NULL", execution_options=None)
    op.execute("UPDATE events SET has_session_speakers = FALSE WHERE has_session_speakers IS NULL", execution_options=None)
    op.alter_column('events', 'has_session_speakers',
                    existing_type=sa.Boolean(),
                    nullable=False)
    op.alter_column('session', 'timezone',
               existing_type=sa.VARCHAR(),
               nullable=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('session', 'timezone',
               existing_type=sa.VARCHAR(),
               nullable=True)
    op.drop_column('events_version', 'has_session_speakers')
    op.drop_column('events', 'has_session_speakers')
    ### end Alembic commands ###