Skip to content
Snippets Groups Projects
Verified Commit 66028d2e authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Add a migration to clean up IP Trunk subscription descriptions

parent 3962bd02
Branches
Tags
1 merge request!408Feature/update v3 migrations
Pipeline #93508 passed
"""Update IP Trunk descriptions.
Removes an outdated to `geant_s_sid` in IP Trunk descriptions. This field has been renamed and adds unnecessary clutter
to the description field.
Revision ID: fffe36624681
Revises: c38adde1a18e
Create Date: 2025-04-18 09:41:28.463681
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = 'fffe36624681'
down_revision = 'c38adde1a18e'
branch_labels = None
depends_on = None
def upgrade() -> None:
conn = op.get_bind()
conn.execute(
sa.text(
"""
UPDATE subscriptions
SET description = Replace(description, 'geant_s_sid:', '')
WHERE product_id = (SELECT product_id
FROM products p
WHERE p.tag = 'IPTRUNK');
"""
)
)
def downgrade() -> None:
# Do nothing
pass
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment