Skip to content

Commit

Permalink
Add new upgrade script for babelfishpg_common 3.3.0-->3.4.0 (#2057)
Browse files Browse the repository at this point in the history
Add new upgrade sciprt for bbf common 3.3--3.4

Signed-off-by: Tanzeel Khan <[email protected]>
  • Loading branch information
tanscorpio7 authored Nov 28, 2023
1 parent 369ea1b commit c57e8bc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
10 changes: 9 additions & 1 deletion contrib/babelfishpg_common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ include $(PGXS)
MODULEPATH = $$libdir/$(EXTENSION)-$(BBFPGCMN_MAJOR_VERSION)

UPGRADES = $(patsubst sql/upgrades/babelfishpg_common--%.sql,sql/babelfishpg_common--%.sql,$(wildcard sql/upgrades/babelfishpg_common--*.sql))
GENERATED_UPGRADES = sql/$(EXTENSION)--3.2.0--3.3.0.sql
GENERATED_UPGRADES = \
sql/$(EXTENSION)--3.2.0--3.3.0.sql \
sql/$(EXTENSION)--3.3.0--3.4.0.sql

ifdef PREV_EXTVERSION
DATA = sql/$(EXTENSION)--$(PREV_EXTVERSION).sql
Expand Down Expand Up @@ -100,13 +102,19 @@ ifeq (,$(filter $(FLAG_TO_CHECK),$(PG_CPPFLAGS)))

sql/$(EXTENSION)--3.2.0--3.3.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D PREV_VERSION=3.2.0 -D CUR_VERSION=3.3.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.3.0--3.4.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D PREV_VERSION=3.3.0 -D CUR_VERSION=3.4.0 $< | sed 's/^# /-- /g' > $@
else
# The flag is present build the .in file including the spatial type files
sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).in
cpp -D ENABLE_SPATIAL_TYPES=1 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.2.0--3.3.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D ENABLE_SPATIAL_TYPES=1 -D PREV_VERSION=3.2.0 -D CUR_VERSION=3.3.0 $< | sed 's/^# /-- /g' > $@

sql/$(EXTENSION)--3.3.0--3.4.0.sql: sql/upgrades/babelfishpg_upgrades.in
cpp -D ENABLE_SPATIAL_TYPES=1 -D PREV_VERSION=3.3.0 -D CUR_VERSION=3.4.0 $< | sed 's/^# /-- /g' > $@
endif

sql/babelfishpg_common--%.sql: sql/upgrades/babelfishpg_common--%.sql
Expand Down
2 changes: 1 addition & 1 deletion contrib/babelfishpg_common/Version.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BBFPGCMN_MAJOR_VERSION=3
BBFPGCMN_MINOR_VERSION=3
BBFPGCMN_MINOR_VERSION=4
BBFPGCMN_MICRO_VERSION=0

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
------------------------------------------------------------------------------
---- Include changes related to other datatypes except spatial types here ----
------------------------------------------------------------------------------

-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION ""babelfishpg_common"" UPDATE TO "3.4.0"" to load this file. \quit

SELECT set_config('search_path', 'sys, '||current_setting('search_path'), false);


-- Reset search_path to not affect any subsequent scripts
SELECT set_config('search_path', trim(leading 'sys, ' from current_setting('search_path')), false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-------------------------------------------------------
---- Include changes related to spatial types here ----
-------------------------------------------------------

0 comments on commit c57e8bc

Please sign in to comment.