"""migrate_to_scuba_artist_image_api Revision ID: 68c9fcfc5fa8 Revises: 98704a7d4665 Create Date: 2022-04-20 12:17:35.474281 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '68c9fcfc5fa8' down_revision = '98704a7d4665' branch_labels = None depends_on = None def upgrade(): bind = op.get_bind() bind.execute(''' update "Image" set url = concat('https://images-api.atlas.stream/v2/artists/by_gras_participant_id/', split_part(url, '/', 6)) where url like 'https://images-api.atlas.stream/artists/by_gras_participant_id/%%'; ''') def downgrade(): bind = op.get_bind() bind.execute(''' update "Image" set url = concat('https://images-api.atlas.stream/artists/by_gras_participant_id/', split_part(url, '/', 7)) where url like 'https://images-api.atlas.stream/v2/artists/by_gras_participant_id/%%'; ''')