"""7_remove_name_from_measurement

Revision ID: 71213454a09a
Revises: f16c6875f138
Create Date: 2017-05-11 14:25:08.256463

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '71213454a09a'
down_revision = 'f16c6875f138'
branch_labels = None
depends_on = None


def upgrade():
        op.execute('''
            UPDATE measurement SET key = name
        ''')
        op.execute('''
            ALTER TABLE measurement DROP COLUMN name;
        ''')


def downgrade():
    pass

"""7_remove_name_from_measurement

Revision ID: 71213454a09a
Revises: f16c6875f138
Create Date: 2017-05-11 14:25:08.256463

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '71213454a09a'
down_revision = 'f16c6875f138'
branch_labels = None
depends_on = None


def upgrade():
    op.execute('''
            ALTER TABLE measurement DROP COLUMN name;
        ''')


def downgrade():
    pass

Fix migration: measurement did not have column key.