Skip to content
Snippets Groups Projects
Commit 5b8b1759 authored by Nathan Bockisch's avatar Nathan Bockisch
Browse files

Update curator metadata.json with product group id

parent dc11b450
No related branches found
No related tags found
2 merge requests!1605Merge 2.8.2.3 work to main,!1526Added the product group ID to the curator products wrester
Pipeline #12843 passed
"""Add product_group_id to the curator workflow metadata.json
Revision ID: f2a76d224984
Revises: 5eaf550162d3
Create Date: 2023-11-15 16:42:50.445896
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "f2a76d224984"
down_revision = "5eaf550162d3"
branch_labels = None
depends_on = None
old_json = """{
"product_locator": "{{product_locator}}",{{#data_location}}
"data_location": "{{data_location}}",{{/data_location}}
"product_type": "{{product_type}}",{{#target_list}}
"target_list": ["{{target_list}}"],{{/target_list}}
"projectMetadata": {
"telescope": "{{telescope}}",
"projectCode": "{{projectCode}}"
}
}
"""
new_json = """{
"product_group_id": "{{product_group_id}}"
"product_locator": "{{product_locator}}",{{#data_location}}
"data_location": "{{data_location}}",{{/data_location}}
"product_type": "{{product_type}}",{{#target_list}}
"target_list": ["{{target_list}}"],{{/target_list}}
"projectMetadata": {
"telescope": "{{telescope}}",
"projectCode": "{{projectCode}}"
}
}
"""
def upgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{new_json}' WHERE filename='metadata.json' AND workflow_name='curator'
"""
)
def downgrade():
op.execute(
f"""
UPDATE workflow_templates
SET content=E'{old_json}' WHERE filename='metadata.json' AND workflow_name='curator'
"""
)
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