From f393b610435feaff6568f598ad4032160ada6f55 Mon Sep 17 00:00:00 2001 From: Zacharias Knudsen Date: Mon, 19 Sep 2022 13:54:10 +0200 Subject: [PATCH] Add pg_validate_extupgrade config --- .github/docker/Dockerfile | 7 +++++++ h3/sql/updates/h3--4.0.0--unreleased.sql | 20 ++++++++++++++++++++ pg_validate_extupgrade.toml | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 h3/sql/updates/h3--4.0.0--unreleased.sql create mode 100644 pg_validate_extupgrade.toml diff --git a/.github/docker/Dockerfile b/.github/docker/Dockerfile index 9d883f8c..e5920f5e 100644 --- a/.github/docker/Dockerfile +++ b/.github/docker/Dockerfile @@ -33,6 +33,13 @@ RUN apt-get update && apt-get install -y \ postgresql-server-dev-${POSTGRESQL} \ postgresql-${POSTGRESQL} +# Setup pg_validate_extupgrade +RUN apt-get update && apt install -y cargo +RUN git clone https://github.com/rjuju/pg_validate_extupgrade.git +WORKDIR pg_validate_extupgrade +RUN cargo build --release +RUN cp ./target/release/pg_validate_extupgrade /usr/bin/ + # Set workdir WORKDIR /github/workspace diff --git a/h3/sql/updates/h3--4.0.0--unreleased.sql b/h3/sql/updates/h3--4.0.0--unreleased.sql new file mode 100644 index 00000000..b3ae648d --- /dev/null +++ b/h3/sql/updates/h3--4.0.0--unreleased.sql @@ -0,0 +1,20 @@ +/* + * Copyright 2022 Bytes & Brains + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "ALTER EXTENSION h3 UPDATE TO 'unreleased'" to load this file. \quit + +-- no changes \ No newline at end of file diff --git a/pg_validate_extupgrade.toml b/pg_validate_extupgrade.toml new file mode 100644 index 00000000..952fa2f3 --- /dev/null +++ b/pg_validate_extupgrade.toml @@ -0,0 +1,6 @@ +extname = 'h3' +from = '3.7.2' +to = '4.0.0' +extra_queries = [ + "SELECT COUNT(*) FROM pg_class WHERE relname = 'dump_0'" +]