fix: covering migrations for wrappers across all versions #1876
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wrappers Extension Migration Files Fix
Problem Summary
The wrappers PostgreSQL extension package was missing migration files and failing to build for PostgreSQL 15, 17, and OrioleDB variants. This document explains the issues encountered and the solutions implemented.
Issues Identified
1. Missing Migration Files for Previously Packaged Versions
Problem:
versions.jsonbut were not included in the build for PostgreSQL 17Solution:
allPreviouslyPackagedVersionslist (lines 175-178 innix/ext/wrappers/default.nix)2. Double-Counting Versions
Problem:
versions(currently built) ANDpreviouslyPackagedVersions(legacy list)Solution:
previouslyPackagedVersionstoallPreviouslyPackagedVersions(line 175)previouslyPackagedVersionsthat excludes versions already inversions(lines 208-211):3. Duplicate Migration File Creation
Problem:
0.4.3--0.4.4.sql)previouslyPackagedVersionstoversionsSolution:
How the Fix Works Across PostgreSQL Versions
PostgreSQL 15
PostgreSQL 17
OrioleDB-17
versions.jsonincludes "orioledb-17" in the postgresql arrayKey Changes to
nix/ext/wrappers/default.nixallPreviouslyPackagedVersionsand added 4 new versionspreviouslyPackagedVersionsexcluding currently built versionscp -Lto dereference symlinks when copyingTesting
The fix has been tested and verified to work correctly for:
nix build .#psql_15/exts/wrappers-all)nix build .#psql_17/exts/wrappers-all)All builds now complete successfully with the correct number of: