old_contents: """ Change metric_type from enum to text
  
  Rename private_poi_dataset to poi_dataset
  
  Revision ID: 858b24967ff2
  Revises: 214932354af8
  Create Date: 2019-07-29 16:36:25.324639
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '858b24967ff2'
  down_revision = '214932354af8'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.add_column('instance', sa.Column('poi_dataset', sa.Text(), nullable=True))
      op.drop_column('instance', 'private_poi_dataset')
      op.alter_column('metric', 'type', type_=sa.TEXT())
      sa.Enum(name='metric_type').drop(op.get_bind(), checkfirst=False)
      # ### end Alembic commands ###
  
  
  def downgrade():
      metric_type = sa.Enum(
          'ed2nav', 'fusio2ed', 'gtfs2ed', 'osm2ed', 'geopal2ed', 'synonym2ed', 'poi2ed', name='metric_type'
      )
      metric_type.create(op.get_bind())
  
      op.alter_column('metric', 'type', new_column_name='_type')
      op.add_column('metric', sa.Column('type', metric_type))
      op.execute("update metric set type=_type::metric_type;")
      op.drop_column('metric', '_type')
  
      # ### commands auto generated by Alembic - please adjust! ###
      op.add_column('instance', sa.Column('private_poi_dataset', sa.TEXT(), autoincrement=False, nullable=True))
      op.drop_column('instance', 'poi_dataset')
      # ### end Alembic commands ###
  
new_contents: """ Change metric_type from enum to text
  
  Rename private_poi_dataset to poi_dataset
  
  Revision ID: 858b24967ff2
  Revises: 214932354af8
  Create Date: 2019-07-29 16:36:25.324639
  
  """
  
  # revision identifiers, used by Alembic.
  revision = '858b24967ff2'
  down_revision = '214932354af8'
  
  from alembic import op
  import sqlalchemy as sa
  
  
  def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.alter_column('metric', 'type', type_=sa.TEXT())
      sa.Enum(name='metric_type').drop(op.get_bind(), checkfirst=False)
      # ### end Alembic commands ###
  
  
  def downgrade():
      metric_type = sa.Enum(
          'ed2nav', 'fusio2ed', 'gtfs2ed', 'osm2ed', 'geopal2ed', 'synonym2ed', 'poi2ed', name='metric_type'
      )
      metric_type.create(op.get_bind())
  
      op.alter_column('metric', 'type', new_column_name='_type')
      op.add_column('metric', sa.Column('type', metric_type))
      op.execute("update metric set type=_type::metric_type;")
      op.drop_column('metric', '_type')
  
      # ### commands auto generated by Alembic - please adjust! ###
      # ### end Alembic commands ###
  
subject: Fix double add column poi_dataset