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

Re-order database migrations

parent 1fed4b46
No related branches found
No related tags found
1 merge request!302Feature/update lan interconnect
Pipeline #90936 passed
"""Update LAN Switch Interconnect. """Update LAN Switch Interconnect.
Revision ID: e854e0c35e20 Revision ID: e854e0c35e20
Revises: 28c1723c6a00 Revises: 79192e72131c
Create Date: 2024-11-04 17:21:14.612740 Create Date: 2024-11-04 17:21:14.612740
""" """
...@@ -10,7 +10,7 @@ from alembic import op ...@@ -10,7 +10,7 @@ from alembic import op
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = 'e854e0c35e20' revision = 'e854e0c35e20'
down_revision = '28c1723c6a00' down_revision = '79192e72131c'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
......
"""remove additional products.
Revision ID: 4cc835c615fc
Revises: 28c1723c6a00
Create Date: 2024-12-04 14:54:22.167158
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '4cc835c615fc'
down_revision = '28c1723c6a00'
branch_labels = None
depends_on = None
def upgrade() -> None:
conn = op.get_bind()
conn.execute(sa.text("""
DELETE FROM product_product_blocks WHERE product_product_blocks.product_id IN (SELECT products.product_id FROM products WHERE products.name IN ('IAS', 'Imported IAS', 'Imported GÉANT IP', 'GÉANT IP')) AND product_product_blocks.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENL3CoreServiceBlock'))
"""))
conn.execute(sa.text("""
DELETE FROM subscription_instances WHERE subscription_instances.product_block_id IN (SELECT product_blocks.product_block_id FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort', 'NRENL3CoreServiceBlock'))
"""))
conn.execute(sa.text("""
DELETE FROM product_blocks WHERE product_blocks.name IN ('NRENAccessPort', 'NRENL3CoreServiceBlock')
"""))
def downgrade() -> None:
conn = op.get_bind()
"""Rename iptrunk and iptrunk side sid and gid. """Rename iptrunk and iptrunk side sid and gid.
Revision ID: e358efe9ab03 Revision ID: e358efe9ab03
Revises: 4cc835c615fc Revises: 28c1723c6a00
Create Date: 2024-12-04 15:05:46.356709 Create Date: 2024-12-04 15:05:46.356709
""" """
...@@ -10,7 +10,7 @@ from alembic import op ...@@ -10,7 +10,7 @@ from alembic import op
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.
revision = 'e358efe9ab03' revision = 'e358efe9ab03'
down_revision = '4cc835c615fc' down_revision = '28c1723c6a00'
branch_labels = None branch_labels = None
depends_on = None depends_on = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment