From d9099e9117ce4ff94b20f181b0c163102839671f Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Wed, 15 Oct 2025 17:00:39 +0300 Subject: [PATCH] Fix migration numbering and add migration 010 for package format (#675) ## Motivation and Context The following PR fixes an issue we introduced on September, 30th that caused some of the migrations to not apply. This PR fixes it. After merging we'll have to reset staging as this would not work there (this is expected). ## How Has This Been Tested? ## Breaking Changes ## Types of changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [ ] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [ ] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed ## Additional context Signed-off-by: Radoslav Dimitrov --- .github/workflows/cancel-pulumi-lock.yml | 2 +- ...7a_clean_invalid_data.sql => 008_clean_invalid_data.sql} | 0 ...cial_metadata.sql => 009_separate_official_metadata.sql} | 0 ...kage_refs.sql => 010_migrate_canonical_package_refs.sql} | 6 +++++- 4 files changed, 6 insertions(+), 2 deletions(-) rename internal/database/migrations/{007a_clean_invalid_data.sql => 008_clean_invalid_data.sql} (100%) rename internal/database/migrations/{008_separate_official_metadata.sql => 009_separate_official_metadata.sql} (100%) rename internal/database/migrations/{009_migrate_canonical_package_refs.sql => 010_migrate_canonical_package_refs.sql} (98%) diff --git a/.github/workflows/cancel-pulumi-lock.yml b/.github/workflows/cancel-pulumi-lock.yml index 786be10..4a447a3 100644 --- a/.github/workflows/cancel-pulumi-lock.yml +++ b/.github/workflows/cancel-pulumi-lock.yml @@ -73,4 +73,4 @@ jobs: run: | echo "$PULUMI_PROD_PASSPHRASE" > passphrase.prod.txt pulumi login gs://mcp-registry-prod-pulumi-state - PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi cancel --stack gcpProd --yes \ No newline at end of file + PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi cancel --stack gcpProd --yes diff --git a/internal/database/migrations/007a_clean_invalid_data.sql b/internal/database/migrations/008_clean_invalid_data.sql similarity index 100% rename from internal/database/migrations/007a_clean_invalid_data.sql rename to internal/database/migrations/008_clean_invalid_data.sql diff --git a/internal/database/migrations/008_separate_official_metadata.sql b/internal/database/migrations/009_separate_official_metadata.sql similarity index 100% rename from internal/database/migrations/008_separate_official_metadata.sql rename to internal/database/migrations/009_separate_official_metadata.sql diff --git a/internal/database/migrations/009_migrate_canonical_package_refs.sql b/internal/database/migrations/010_migrate_canonical_package_refs.sql similarity index 98% rename from internal/database/migrations/009_migrate_canonical_package_refs.sql rename to internal/database/migrations/010_migrate_canonical_package_refs.sql index db7fd91..cb65012 100644 --- a/internal/database/migrations/009_migrate_canonical_package_refs.sql +++ b/internal/database/migrations/010_migrate_canonical_package_refs.sql @@ -5,6 +5,8 @@ -- - Removes package-type-specific forbidden fields (e.g., fileSha256 from non-MCPB packages) -- - Ensures all packages have required transport field +BEGIN; + -- Helper function to convert OCI package to canonical reference format CREATE OR REPLACE FUNCTION convert_oci_package_to_canonical(pkg jsonb) RETURNS jsonb @@ -197,4 +199,6 @@ DROP FUNCTION IF EXISTS convert_oci_package_to_canonical(jsonb); DROP FUNCTION IF EXISTS convert_mcpb_package_to_canonical(jsonb); DROP FUNCTION IF EXISTS remove_forbidden_fields(jsonb); DROP FUNCTION IF EXISTS ensure_transport_field(jsonb); -DROP FUNCTION IF EXISTS convert_packages_array(jsonb); \ No newline at end of file +DROP FUNCTION IF EXISTS convert_packages_array(jsonb); + +COMMIT; \ No newline at end of file