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

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.
Fix migration: measurement did not have column key.

  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('''
+     op.execute('''
-             UPDATE measurement SET key = name
-         ''')
-         op.execute('''
              ALTER TABLE measurement DROP COLUMN name;
          ''')
  
  
  def downgrade():
      pass
  
Fix migration: measurement did not have column key.
## Code Before:
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

## Instruction:
Fix migration: measurement did not have column key.
## Code After:
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
