Skip to content

Commit cd14247

Browse files
committed
Stop generating migration files for each version
PostgreSQL 10 introduced an improvement on extension migration paths. We no longer need to generate a migration file for each version. It is sufficient to have an initial script and the migration scripts that are used to upgrade to the next version. This commit also fixes an issue where we did not install necessary migration files on a clean build.
1 parent bd1eba0 commit cd14247

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ regression.diffs
77
results
88
.deps/
99

10-
hll--*.*.sql
11-
!update/hll--*.*.sql
10+
/*.sql

Makefile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
EXTENSION = hll
15-
EXTVERSIONS = 2.10 2.11 2.12 2.13 2.14 2.15 2.16
16-
17-
DATA_built = $(foreach v,$(EXTVERSIONS),$(EXTENSION)--$(v).sql) $(wildcard $(EXTENSION)--*--*.sql)
15+
sql_files = $(wildcard update/$(EXTENSION)--*.sql)
16+
generated_sql_files = $(patsubst update/%,%,$(sql_files))
17+
DATA_built = $(generated_sql_files)
1818

1919
MODULE_big = $(EXTENSION)
2020
OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c)) $(patsubst %.cpp,%.o,$(wildcard src/*.cpp))
@@ -34,16 +34,3 @@ src/hll.o: override CFLAGS += -std=c99
3434

3535
%.sql: update/%.sql
3636
$(SQLPP) $^ > $@
37-
38-
$(EXTENSION)--2.11.sql: $(EXTENSION)--2.10.sql $(EXTENSION)--2.10--2.11.sql
39-
cat $^ > $@
40-
$(EXTENSION)--2.12.sql: $(EXTENSION)--2.11.sql $(EXTENSION)--2.11--2.12.sql
41-
cat $^ > $@
42-
$(EXTENSION)--2.13.sql: $(EXTENSION)--2.12.sql $(EXTENSION)--2.12--2.13.sql
43-
cat $^ > $@
44-
$(EXTENSION)--2.14.sql: $(EXTENSION)--2.13.sql $(EXTENSION)--2.13--2.14.sql
45-
cat $^ > $@
46-
$(EXTENSION)--2.15.sql: $(EXTENSION)--2.14.sql $(EXTENSION)--2.14--2.15.sql
47-
cat $^ > $@
48-
$(EXTENSION)--2.16.sql: $(EXTENSION)--2.15.sql $(EXTENSION)--2.15--2.16.sql
49-
cat $^ > $@

0 commit comments

Comments
 (0)