File tree Expand file tree Collapse file tree 2 files changed +41
-7
lines changed Expand file tree Collapse file tree 2 files changed +41
-7
lines changed Original file line number Diff line number Diff line change 471471 }
472472 },
473473 "wrappers" : {
474+ "0.4.5" : {
475+ "postgresql" : [
476+ " 15" ,
477+ " 17"
478+ ],
479+ "hash" : " sha256-IgDfVFROMCHYLZ/Iqj12MsQjPPCdRoH+3oi3Ki/iaRI=" ,
480+ "pgrx" : " 0.12.9" ,
481+ "rust" : " 1.81.0"
482+ },
483+ "0.4.6" : {
484+ "postgresql" : [
485+ " 15" ,
486+ " 17"
487+ ],
488+ "hash" : " sha256-hthb3qEXT1Kf4yPoq0udEbQzlyLtI5tug6sK4YAPFjU=" ,
489+ "pgrx" : " 0.12.9" ,
490+ "rust" : " 1.84.0"
491+ },
492+ "0.5.0" : {
493+ "postgresql" : [
494+ " 15" ,
495+ " 17"
496+ ],
497+ "hash" : " sha256-FbRTUcpEHBa5DI6dutvBeahYM0RZVAXIzIAZWIaxvn0=" ,
498+ "pgrx" : " 0.12.9" ,
499+ "rust" : " 1.84.0"
500+ },
474501 "0.5.4" : {
475502 "postgresql" : [
476503 " 15" ,
Original file line number Diff line number Diff line change 162162 }
163163 ) ;
164164 previouslyPackagedVersions = [
165- "0.5.3"
166- "0.5.2"
167- "0.5.1"
168- "0.5.0"
169- "0.4.6"
170- "0.4.5"
171165 "0.4.4"
172166 "0.4.3"
173167 "0.4.2"
@@ -214,6 +208,7 @@ buildEnv {
214208 "/share/postgresql/extension"
215209 ] ;
216210 postBuild = ''
211+
217212 create_control_files() {
218213 # Create main control file pointing to latest version
219214 {
@@ -233,6 +228,19 @@ buildEnv {
233228 }
234229
235230 create_migration_sql_files() {
231+ PREVIOUS_VERSION=""
232+ while IFS= read -r i; do
233+ FILENAME=$(basename "$i")
234+ DIRNAME=$(dirname "$i")
235+ VERSION="$(grep -oE '[0-9]+\.[0-9]+\.[0-9]+' <<< $FILENAME)"
236+ if [[ "$PREVIOUS_VERSION" != "" ]]; then
237+ echo "Processing $i"
238+ MIGRATION_FILENAME="$DIRNAME/'' ${FILENAME/$VERSION/$PREVIOUS_VERSION--$VERSION}"
239+ cp "$i" "$MIGRATION_FILENAME"
240+ fi
241+ PREVIOUS_VERSION="$VERSION"
242+ done < <(find $out -name '*.sql' | sort -V)
243+
236244 # Create migration SQL files from previous versions to newer versions
237245 for prev_version in ${ lib . concatStringsSep " " previouslyPackagedVersions } ; do
238246 for curr_version in ${ lib . concatStringsSep " " versions } ; do
@@ -252,7 +260,6 @@ buildEnv {
252260 create_lib_files
253261 create_migration_sql_files
254262
255- # checks
256263 (test "$(ls -A $out/lib/${ pname } *${ postgresql . dlSuffix } | wc -l)" = "${
257264 toString ( numberOfVersions + numberOfPreviouslyPackagedVersions + 1 )
258265 } ")
You can’t perform that action at this time.
0 commit comments