This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CREATE OR REPLACE in sql scripts
- Loading branch information
1 parent
0f60fe3
commit 83c40d5
Showing
5 changed files
with
28 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "pgmer2" | ||
version = "0.3.10" | ||
version = "0.3.11" | ||
edition = "2021" | ||
|
||
[lib] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FOLDER=$1 | ||
if [ ! -d "$FOLDER" ]; then | ||
echo "Invalid arguments" | ||
exit 1 | ||
fi | ||
|
||
VER=$( cargo read-manifest | jq -r '.version' ) | ||
|
||
VER0=$( echo $VER | awk -F. -v OFS=. '{$NF -= 1; print}' ) | ||
VER1=$( echo $VER | awk -F. -v OFS=. '{$NF -= 2; print}' ) | ||
VER2=$( echo $VER | awk -F. -v OFS=. '{$NF -= 3; print}' ) | ||
VER2=$( echo $VER | awk -F. -v OFS=. '{$NF -= 4; print}' ) | ||
|
||
[ -d extension ] || mkdir extension | ||
sed 's/CREATE FUNCTION/CREATE OR REPLACE FUNCTION/g' "$FOLDER/pgmer2--$VER.sql" > "extension/pgmer2--$VER.sql" | ||
cp extension/pgmer2--$VER.sql extension/pgmer2--$VER3--$VER.sql | ||
cp extension/pgmer2--$VER.sql extension/pgmer2--$VER2--$VER.sql | ||
cp extension/pgmer2--$VER.sql extension/pgmer2--$VER1--$VER.sql | ||
cp extension/pgmer2--$VER.sql extension/pgmer2--$VER0--$VER.sql | ||
cp "$FOLDER/pgmer2.control" extension/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters