"""mark_various_unknown_artists_as_unknown Revision ID: e8efbcb0183e Revises: a38b21bdc1ca Create Date: 2021-08-10 12:34:59.626938 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'e8efbcb0183e' down_revision = '244f65457dc5' branch_labels = None depends_on = None ids_to_update = [884379, 889377, 886529, 884861, 884533, 884537, 884859, 884377, 884858, 886043, 884376, 888092, 888261, 889085, 888091, 884864, 884378, 886528, 884534, 884535, 884860, 99999, 884862, 1921858, 1941135, 39823, 817810, 822791] def upgrade(): bind = op.get_bind() meta = sa.MetaData(bind=bind) meta.reflect() artist_table = meta.tables["Artist"] op.execute( artist_table.update().values( is_unknown=True ).where(artist_table.c.external_id.in_([f"GRAS_{t}" for t in ids_to_update])) )