"""music preference table

Revision ID: d706e5904d85
Revises: c29fdc8588d9
Create Date: 2016-05-30 15:24:47.082457

"""

# revision identifiers, used by Alembic.
revision = 'd706e5904d85'
down_revision = 'c29fdc8588d9'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy.dialects import postgresql


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('music_preference',
                    sa.Column(
                        'id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=False),
                    sa.Column('genre', sa.String(length=100), nullable=True),
                    sa.Column(
                        'user_id', sqlalchemy_utils.types.uuid.UUIDType(), nullable=True),
                    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.drop_column('user_activity', 'temperature')
    op.drop_column('user_activity', 'raining_outside')
    op.add_column(
        'gym', sa.Column('spotify_playlist_id', sa.String(length=50), nullable=True))

    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_activity', sa.Column(
        'raining_outside', sa.BOOLEAN(), autoincrement=False, nullable=True))
    op.add_column('user_activity', sa.Column(
        'temperature', sa.REAL(), autoincrement=False, nullable=True))
    op.drop_column('gym', 'spotify_playlist_id')
    op.drop_table('music_preference')
    ### end Alembic commands ###
