Server extension makefile migrate the upgrades and downgrades too

This commit is contained in:
Mario de Frutos
2016-01-22 17:24:18 +01:00
parent e46600325b
commit d3d6147b8e

View File

@@ -3,8 +3,18 @@
EXTENSION = cdb_geocoder_server
EXTVERSION = $(shell grep default_version $(EXTENSION).control | sed -e "s/default_version[[:space:]]*=[[:space:]]*'\([^']*\)'/\1/")
DATA = $(EXTENSION)--$(EXTVERSION).sql \
$(UPGRADES)
# The new version to be generated from templates
NEW_EXTENSION_ARTIFACT = $(EXTENSION)--$(EXTVERSION).sql
# DATA is a special variable used by postgres build infrastructure
# These are the files to be installed in the server shared dir,
# for installation from scratch, upgrades and downgrades.
# @see http://www.postgresql.org/docs/current/static/extend-pgxs.html
DATA = $(NEW_EXTENSION_ARTIFACT) \
cdb_geocoder_server--0.0.1.sql \
cdb_geocoder_server--0.1.0--0.0.1.sql \
cdb_geocoder_server--0.0.1--0.1.0.sql
REGRESS = $(notdir $(basename $(wildcard test/$(EXTVERSION)/sql/*test.sql)))
TEST_DIR = test/$(EXTVERSION)
@@ -21,6 +31,10 @@ $(DATA): $(SOURCES_DATA)
rm -f $@
cat $(SOURCES_DATA) >> $@
$(NEW_EXTENSION_ARTIFACT): $(SOURCES_DATA)
rm -f $@
cat $(SOURCES_DATA_DIR)/*.sql >> $@
all: $(DATA)
# Only meant for development time, do not use once a version is released