"""empty message

Revision ID: 602c0025e2f5
Revises: 
Create Date: 2017-05-30 20:07:22.649271

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '602c0025e2f5'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tracks',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('artist_name', sa.String(), nullable=False),
    sa.Column('title', sa.String(), nullable=False),
    sa.Column('release', sa.String(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=80), nullable=False),
    sa.Column('password_hash', sa.String(length=120), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=True)
    op.create_table('meta_data',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('track_id', sa.Integer(), nullable=False),
    sa.Column('year', sa.Integer(), nullable=True),
    sa.Column('artist_familiarity', sa.Float(), nullable=True),
    sa.Column('artist_hotness', sa.Float(), nullable=True),
    sa.Column('artist_latitude', sa.Float(), nullable=True),
    sa.Column('artist_longitude', sa.Float(), nullable=True),
    sa.Column('duration', sa.Float(), nullable=True),
    sa.Column('end_of_fade_in', sa.Float(), nullable=True),
    sa.Column('key', sa.Integer(), nullable=True),
    sa.Column('key_confidence', sa.Float(), nullable=True),
    sa.Column('loudness', sa.Float(), nullable=True),
    sa.Column('mode', sa.Integer(), nullable=True),
    sa.Column('mode_confidence', sa.Float(), nullable=True),
    sa.Column('song_hotness', sa.Float(), nullable=True),
    sa.Column('start_of_fade_out', sa.Float(), nullable=True),
    sa.Column('tempo', sa.Float(), nullable=True),
    sa.Column('time_signature', sa.Integer(), nullable=True),
    sa.Column('time_signature_confidence', sa.Float(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['track_id'], ['tracks.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_meta_data_track_id'), 'meta_data', ['track_id'], unique=False)
    op.create_table('votes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('track_id', sa.Integer(), nullable=False),
    sa.Column('vote_flag', sa.Boolean(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('updated_at', sa.DateTime(), nullable=False),
    sa.ForeignKeyConstraint(['track_id'], ['tracks.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('votes')
    op.drop_index(op.f('ix_meta_data_track_id'), table_name='meta_data')
    op.drop_table('meta_data')
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_table('users')
    op.drop_table('tracks')
    # ### end Alembic commands ###
