Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
f04c36af
Commit
f04c36af
authored
1 month ago
by
Saket Agrahari
Browse files
Options
Downloads
Patches
Plain Diff
Add service configuration for backfill iptrunk config version
parent
3e236876
No related branches found
No related tags found
1 merge request
!425
Resolve #1048 "Service config backfilling"
Pipeline
#94446
passed
1 month ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/migrations/versions/2025-05-28_90547df711c3_backfill_iptrunk_config_version.py
+48
-0
48 additions, 0 deletions
...025-05-28_90547df711c3_backfill_iptrunk_config_version.py
with
48 additions
and
0 deletions
gso/migrations/versions/2025-05-28_90547df711c3_backfill_iptrunk_config_version.py
0 → 100644
+
48
−
0
View file @
f04c36af
"""
empty message.
Revision ID: 90547df711c3
Revises: 54477431c9ef
Create Date: 2025-05-28 10:15:07.579188
"""
import
sqlalchemy
as
sa
from
alembic
import
op
# revision identifiers, used by Alembic.
revision
=
'
90547df711c3
'
down_revision
=
'
54477431c9ef
'
branch_labels
=
None
depends_on
=
None
def
upgrade
()
->
None
:
conn
=
op
.
get_bind
()
conn
.
execute
(
sa
.
text
(
"""
WITH rt_id AS (
SELECT resource_type_id FROM resource_types WHERE resource_type =
'
iptrunk_config_version
'
)
INSERT INTO subscription_instance_values (subscription_instance_id, resource_type_id, value)
SELECT si.subscription_instance_id, rt_id.resource_type_id,
'
1.0
'
FROM rt_id, subscription_instances si
WHERE si.product_block_id = (
SELECT product_block_id FROM product_blocks WHERE name =
'
IptrunkBlock
'
);
"""
))
def
downgrade
()
->
None
:
conn
=
op
.
get_bind
()
conn
.
execute
(
sa
.
text
(
"""
WITH rt_id AS (
SELECT resource_type_id FROM resource_types WHERE resource_type =
'
iptrunk_config_version
'
)
DELETE FROM subscription_instance_values
WHERE resource_type_id = (SELECT resource_type_id FROM rt_id)
AND value =
'
1.0
'
AND subscription_instance_id IN (
SELECT subscription_instance_id FROM subscription_instances
WHERE product_block_id = (
SELECT product_block_id FROM product_blocks WHERE name =
'
IptrunkBlock
'
)
);
"""
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment