From 4972d37b033e5ca45ca27d73e705286c764b2715 Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Thu, 22 Sep 2022 13:16:03 -0400 Subject: [PATCH] Add upgrade paths for pointcloud_postgis. Closes #307 --- pgsql_postgis/Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pgsql_postgis/Makefile b/pgsql_postgis/Makefile index 605262b..12c58fb 100644 --- a/pgsql_postgis/Makefile +++ b/pgsql_postgis/Makefile @@ -7,10 +7,20 @@ include ../config.mk SED = sed EXTENSION = pointcloud_postgis EXTVERSION=$(shell cat ../Version.config) + +UPGRADABLE = 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 +UPGRADES = \ + $(shell echo $(UPGRADABLE) | \ + $(SED) 's/^/$(EXTENSION)--/' | \ + $(SED) 's/$$/--$(EXTVERSION).sql/' | \ + $(SED) 's/ /--$(EXTVERSION).sql $(EXTENSION)--/g') \ + $(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql \ + $(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql + DATA_built = \ $(EXTENSION).control \ - $(EXTENSION)--$(EXTVERSION).sql - + $(EXTENSION)--$(EXTVERSION).sql \ + $(UPGRADES) #REGRESS = pointcloud # Add in build/link flags for lib @@ -25,3 +35,10 @@ $(EXTENSION).control: $(EXTENSION).control.in Makefile $(EXTENSION)--$(EXTVERSION).sql: $(EXTENSION).sql.in Makefile $(SED) -e 's/@POINTCLOUD_VERSION@/$(EXTVERSION)/' $< > $@ + +# NOTE: relies on PERL being defined by PGXS +$(EXTENSION)--%--$(EXTVERSION).sql: $(EXTENSION)--$(EXTVERSION).sql ../util/proc_upgrade.pl + cat $< | ../util/proc_upgrade.pl > $@ + +$(EXTENSION)--%--$(EXTVERSION)next.sql: $(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql + ln -f $< $@ \ No newline at end of file