"""industry index remove date

Revision ID: 88d46e8e73ef
Revises: 6543398f0773
Create Date: 2016-03-08 19:51:18.026000

"""

# revision identifiers, used by Alembic.
revision = '88d46e8e73ef'
down_revision = '6543398f0773'

import sqlalchemy as sa

from alembic import op
from sqlalchemy.dialects import mysql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('industry_index', 'date')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('industry_index', sa.Column('date', mysql.DATETIME(), nullable=False))
    ### end Alembic commands ###

"""industry index remove date

Revision ID: 88d46e8e73ef
Revises: 6543398f0773
Create Date: 2016-03-08 19:51:18.026000

"""

# revision identifiers, used by Alembic.
revision = '88d46e8e73ef'
down_revision = '6543398f0773'

import sqlalchemy as sa

from alembic import op
from sqlalchemy.dialects import mysql


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(u'industry_index_ibfk_1', 'industry_index', type_='foreignkey')
    op.drop_constraint('PRIMARY', 'industry_index', type_='primary')
    op.drop_column('industry_index', 'date')
    op.create_primary_key("industry_index_pk", "industry_index", ['solarsystem_id', 'activity'])
    op.create_foreign_key("industry_index_ibfk_1", 'industry_index', 'solar_system', ['solarsystem_id'], ['id'])
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(u'industry_index_ibfk_1', 'industry_index', type_='foreignkey')
    op.drop_constraint('PRIMARY', 'industry_index', type_='primary')
    op.add_column('industry_index', sa.Column('date', mysql.DATETIME(), nullable=False))
    op.create_primary_key("industry_index_pk", "industry_index", ['solarsystem_id', 'activity', 'date'])
    op.create_foreign_key("industry_index_ibfk_1", 'industry_index', 'solar_system', ['solarsystem_id'], ['id'])
    ### end Alembic commands ###

Fix migration file that didn't work correctly