From 2864f489686aff178d7a8c8888365e15e1f57a64 Mon Sep 17 00:00:00 2001 From: Jonas Thelemann Date: Fri, 20 Nov 2026 17:24:00 +0100 Subject: [PATCH 1/4] feat(postgres)!: use the vibetype image for both databases (#366) --- .renovaterc.json | 10 ---------- docs/sqitch-major-upgrade-rehearse.sh | 2 +- src/development/postgres/compose.yaml | 7 +------ src/development/reccoom/compose.yaml | 2 +- 4 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.renovaterc.json b/.renovaterc.json index 7930f2b4..477b15f4 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -8,16 +8,6 @@ "matchStrings": [ "#\\s+renovate:\\s+datasource=github-releases\\s+depName=(?\\S+)\\s+\\w+:\\s+(?\\S+)" ] - }, - { - "autoReplaceStringTemplate": "image: {{{depName}}}:{{{newValue}}}{{#if newDigest}}@{{{newDigest}}}{{/if}}", - "customType": "regex", - "datasourceTemplate": "docker", - "description": "the docker-compose manager skips images nested below an extension key, like a dargstack platform override", - "managerFilePatterns": ["/^src/development/postgres/compose\\.yaml$/"], - "matchStrings": [ - "image:\\s+(?imresamu/postgis):(?[^@\\s]+)(?:@(?sha256:[a-f0-9]+))?" - ] } ], "extends": ["github>dargmuesli/renovate-config"], diff --git a/docs/sqitch-major-upgrade-rehearse.sh b/docs/sqitch-major-upgrade-rehearse.sh index 77a56361..4164e2fc 100755 --- a/docs/sqitch-major-upgrade-rehearse.sh +++ b/docs/sqitch-major-upgrade-rehearse.sh @@ -44,7 +44,7 @@ EOF } docker network create "$NAME" > /dev/null -docker run -d --name "$NAME" --network "$NAME" -e POSTGRES_DB=vibetype -e POSTGRES_PASSWORD=postgres postgis/postgis:18-3.6-alpine > /dev/null +docker run -d --name "$NAME" --network "$NAME" -e POSTGRES_DB=vibetype -e POSTGRES_PASSWORD=postgres ghcr.io/maevsi/postgres:1.0.0 > /dev/null # the image's init phase runs a temporary server on the socket only, so tcp answers once the real one is up # A failing `docker exec` looks like a server that is not up yet, so give up after two minutes and show its error. WAITED=0 diff --git a/src/development/postgres/compose.yaml b/src/development/postgres/compose.yaml index ad099891..3ec9928b 100644 --- a/src/development/postgres/compose.yaml +++ b/src/development/postgres/compose.yaml @@ -61,7 +61,7 @@ services: timeout: 5s retries: 5 start_period: 30s - image: postgis/postgis:18-3.7-alpine@sha256:e1a18d273904ee86646d6d1379f318f74864a017b5aad710ed14a692212651cb + image: ghcr.io/maevsi/postgres:1.0.0@sha256:bc38cf3f0650cd3c438cb2f8a8c3dacfa4ca4caf712883b96f9f2380462f333a ports: # dargstack:dev-only - 5432:5432 # dargstack:dev-only secrets: @@ -80,11 +80,6 @@ volumes: # The database's data. {} x-dargstack: - platform: - darwin: - services: - postgres: - image: imresamu/postgis:18-3.6-alpine@sha256:f1f6a9fcccf493fa958e54cca5ad9be964ca7f6f4d2cd9cf24194bfd21ef862d secrets: postgres-db: type: wordlist_word diff --git a/src/development/reccoom/compose.yaml b/src/development/reccoom/compose.yaml index a0d3aa0c..2c3fafd8 100644 --- a/src/development/reccoom/compose.yaml +++ b/src/development/reccoom/compose.yaml @@ -152,7 +152,7 @@ services: timeout: 5s retries: 5 start_period: 30s - image: pgvector/pgvector:0.8.7-pg18@sha256:38681dc6eaf55308e2a4c6de392d131652dcfac70e1263e35cd9b5ea3fe39782 + image: ghcr.io/maevsi/postgres:1.0.0@sha256:bc38cf3f0650cd3c438cb2f8a8c3dacfa4ca4caf712883b96f9f2380462f333a ports: # dargstack:dev-only - 5433:5432 # dargstack:dev-only secrets: From 13de5229d1a7704c8649aa975af67a4980c78c4f Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 20 Nov 2026 16:24:44 +0000 Subject: [PATCH 2/4] chore(release): 23.0.0-beta.1 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [23.0.0-beta.1](https://github.com/maevsi/stack/compare/22.0.2...23.0.0-beta.1) (2026-11-20) ### ⚠ BREAKING CHANGES * **postgres:** use the vibetype image for both databases (#366) ### Features * **postgres:** use the vibetype image for both databases ([#366](https://github.com/maevsi/stack/issues/366)) ([2864f48](https://github.com/maevsi/stack/commit/2864f489686aff178d7a8c8888365e15e1f57a64)) --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cffdc1c5..53d6673c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [23.0.0-beta.1](https://github.com/maevsi/stack/compare/22.0.2...23.0.0-beta.1) (2026-11-20) + +### ⚠ BREAKING CHANGES + +* **postgres:** use the vibetype image for both databases (#366) + +### Features + +* **postgres:** use the vibetype image for both databases ([#366](https://github.com/maevsi/stack/issues/366)) ([2864f48](https://github.com/maevsi/stack/commit/2864f489686aff178d7a8c8888365e15e1f57a64)) + ## [22.0.2](https://github.com/maevsi/stack/compare/22.0.1...22.0.2) (2026-11-20) ### Bug Fixes From f2b9d3cb6bdd834fdb39900dc029a7f107654dc3 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Sat, 28 Nov 2026 12:44:17 +0000 Subject: [PATCH 3/4] chore(release): 23.0.0-beta.2 [skip ci] ## [23.0.0-beta.2](https://github.com/maevsi/stack/compare/23.0.0-beta.1...23.0.0-beta.2) (2026-11-28) ### Features * **postgraphile:** pass the openai api key ([#369](https://github.com/maevsi/stack/issues/369)) ([adae197](https://github.com/maevsi/stack/commit/adae1976ef481c202cc64c92086a4623ad893d44)) * **zammad:** remove backup service ([#375](https://github.com/maevsi/stack/issues/375)) ([dd1ad0e](https://github.com/maevsi/stack/commit/dd1ad0ed2dacb337fc372567831d56ca49ec3aec)) ### Bug Fixes * **compose:** forward stop signals to setup jobs ([#368](https://github.com/maevsi/stack/issues/368)) ([215cb15](https://github.com/maevsi/stack/commit/215cb15920b6aa5aeffb92b07e323b79733ad1ed)) * **deps:** update all non-major dependencies ([24c2d19](https://github.com/maevsi/stack/commit/24c2d19cd8fd5734db9038e7383b23633a77c073)) * **deps:** update all non-major dependencies ([6adc6d0](https://github.com/maevsi/stack/commit/6adc6d0f9384da5539e32ce659e698adf6571654)) * **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.60.0 ([fc3b8b6](https://github.com/maevsi/stack/commit/fc3b8b6e6c62c1cdc753adff2e9f4bc2384b0c72)) * **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.61.2 ([fc7d8b5](https://github.com/maevsi/stack/commit/fc7d8b5f9b60f209be5fc10de004f032ffa43361)) * **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.61.5 ([7d7836e](https://github.com/maevsi/stack/commit/7d7836e9e49c3f400f46c950f67c3919c49ed0ec)) * **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.62.0 ([4daa248](https://github.com/maevsi/stack/commit/4daa248717eab33c12e6bd8daf9b2b5904281576)) * **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.64.0 ([ce770ef](https://github.com/maevsi/stack/commit/ce770ef5bdfd2340d18a86ae5eb5c5ae1ae2a186)) * **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.66.0 ([c33a49c](https://github.com/maevsi/stack/commit/c33a49c5ceb8cc8efba417002acf95e5b84b950e)) * **deps:** update maevsi images ([4f55931](https://github.com/maevsi/stack/commit/4f5593154589def22244103cd2e1087f2878f050)) * **deps:** update maevsi images ([1166ab2](https://github.com/maevsi/stack/commit/1166ab2363d1f1268eb1077a20b1d8d3f787f9cb)) * **deps:** update maevsi images ([8847fbe](https://github.com/maevsi/stack/commit/8847fbecf593d480ba91ab27cbeaf1a694684a3e)) * **images:** replace digests that no longer resolve ([#367](https://github.com/maevsi/stack/issues/367)) ([9e4b3bd](https://github.com/maevsi/stack/commit/9e4b3bd85a66bff065ead542ee2859ab486495bd)) --- CHANGELOG.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53d6673c..7018c24b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +## [23.0.0-beta.2](https://github.com/maevsi/stack/compare/23.0.0-beta.1...23.0.0-beta.2) (2026-11-28) + +### Features + +* **postgraphile:** pass the openai api key ([#369](https://github.com/maevsi/stack/issues/369)) ([adae197](https://github.com/maevsi/stack/commit/adae1976ef481c202cc64c92086a4623ad893d44)) +* **zammad:** remove backup service ([#375](https://github.com/maevsi/stack/issues/375)) ([dd1ad0e](https://github.com/maevsi/stack/commit/dd1ad0ed2dacb337fc372567831d56ca49ec3aec)) + +### Bug Fixes + +* **compose:** forward stop signals to setup jobs ([#368](https://github.com/maevsi/stack/issues/368)) ([215cb15](https://github.com/maevsi/stack/commit/215cb15920b6aa5aeffb92b07e323b79733ad1ed)) +* **deps:** update all non-major dependencies ([24c2d19](https://github.com/maevsi/stack/commit/24c2d19cd8fd5734db9038e7383b23633a77c073)) +* **deps:** update all non-major dependencies ([6adc6d0](https://github.com/maevsi/stack/commit/6adc6d0f9384da5539e32ce659e698adf6571654)) +* **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.60.0 ([fc3b8b6](https://github.com/maevsi/stack/commit/fc3b8b6e6c62c1cdc753adff2e9f4bc2384b0c72)) +* **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.61.2 ([fc7d8b5](https://github.com/maevsi/stack/commit/fc7d8b5f9b60f209be5fc10de004f032ffa43361)) +* **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.61.5 ([7d7836e](https://github.com/maevsi/stack/commit/7d7836e9e49c3f400f46c950f67c3919c49ed0ec)) +* **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.62.0 ([4daa248](https://github.com/maevsi/stack/commit/4daa248717eab33c12e6bd8daf9b2b5904281576)) +* **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.64.0 ([ce770ef](https://github.com/maevsi/stack/commit/ce770ef5bdfd2340d18a86ae5eb5c5ae1ae2a186)) +* **deps:** update ghcr.io/maevsi/vibetype docker tag to v17.66.0 ([c33a49c](https://github.com/maevsi/stack/commit/c33a49c5ceb8cc8efba417002acf95e5b84b950e)) +* **deps:** update maevsi images ([4f55931](https://github.com/maevsi/stack/commit/4f5593154589def22244103cd2e1087f2878f050)) +* **deps:** update maevsi images ([1166ab2](https://github.com/maevsi/stack/commit/1166ab2363d1f1268eb1077a20b1d8d3f787f9cb)) +* **deps:** update maevsi images ([8847fbe](https://github.com/maevsi/stack/commit/8847fbecf593d480ba91ab27cbeaf1a694684a3e)) +* **images:** replace digests that no longer resolve ([#367](https://github.com/maevsi/stack/issues/367)) ([9e4b3bd](https://github.com/maevsi/stack/commit/9e4b3bd85a66bff065ead542ee2859ab486495bd)) + ## [23.0.0-beta.1](https://github.com/maevsi/stack/compare/22.0.2...23.0.0-beta.1) (2026-11-20) ### ⚠ BREAKING CHANGES From 08a375cb9d7b9afdcf3e3c42d6880f219cb22763 Mon Sep 17 00:00:00 2001 From: Jonas Thelemann Date: Sat, 28 Nov 2026 13:45:52 +0100 Subject: [PATCH 4/4] docs(sqitch): add the upgrade script for 14 (#372) --- docs/sqitch-major-upgrade-14.sql | 142 ++++++++++++++++++++++++++ docs/sqitch-major-upgrade-rehearse.sh | 3 + docs/sqitch-major-upgrade.md | 13 ++- 3 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 docs/sqitch-major-upgrade-14.sql diff --git a/docs/sqitch-major-upgrade-14.sql b/docs/sqitch-major-upgrade-14.sql new file mode 100644 index 00000000..07027bc2 --- /dev/null +++ b/docs/sqitch-major-upgrade-14.sql @@ -0,0 +1,142 @@ +-- Copies the data of the sqitch 13 schemas, renamed to `_old`, into the schemas a fresh `sqitch deploy` of sqitch 14 created. +-- For the next major, copy this file to `sqitch-major-upgrade-.sql` and replace the parts marked as specific to sqitch 14; the rest is generic. +-- Only columns that exist in both generations are copied, so columns dropped by the major are left behind instead of failing the whole restore. +-- Constraints (check, not null, unique) stay enforced; triggers and foreign key checks are skipped, so tables can be filled in any order. +-- Run as the database superuser with `psql -v ON_ERROR_STOP=1`; everything happens in one transaction and is undone on any error. + +BEGIN; + +SET LOCAL session_replication_role = replica; + +-- Specific to sqitch 14: it drops the `unlisted` event visibility, which never behaved differently from `private`. +-- sqitch 13.10.2 converted the stored rows, but events created as unlisted since then would fail the enum cast of the copy. +UPDATE vibetype_old.event SET visibility = 'private' WHERE visibility = 'unlisted'; + +-- Specific to sqitch 14: a contact's single `email_address` becomes the list `email_addresses`. +-- A temporary column of the new name lets the generic copy take it over, and is dropped again below, so a rollback finds the old schema unchanged. +ALTER TABLE vibetype_old.contact ADD COLUMN email_addresses TEXT[]; +UPDATE vibetype_old.contact SET email_addresses = ARRAY[email_address] WHERE email_address IS NOT NULL; + +DO $$ +DECLARE + _table RECORD; + _columns TEXT; + _values TEXT; + _overriding TEXT; + _count BIGINT; + _left_behind TEXT; +BEGIN + FOR _table IN + SELECT n.nspname AS schema_name, c.relname AS table_name, c.oid AS table_new, to_regclass(format('%I.%I', n.nspname || '_old', c.relname)) AS table_old + FROM pg_class c + JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE n.nspname IN ('vibetype', 'vibetype_private') AND c.relkind IN ('r', 'p') + ORDER BY 1, 2 + LOOP + IF _table.table_old IS NULL THEN + RAISE NOTICE '%.%: new table, nothing to copy', _table.schema_name, _table.table_name; + CONTINUE; + END IF; + + SELECT + string_agg(format('%I', a_new.attname), ', ' ORDER BY a_new.attnum), + -- a differing type is mostly an enum or composite of the old schema generation, which converts through its text form + -- composites go through json instead, so attributes the major added become null rather than failing the cast + string_agg( + CASE WHEN a_new.atttypid = a_old.atttypid THEN format('%I', a_new.attname) + WHEN (SELECT typtype FROM pg_type WHERE oid = a_new.atttypid) = 'c' THEN format('json_populate_record(NULL::%s, to_json(%I))', format_type(a_new.atttypid, a_new.atttypmod), a_new.attname) + ELSE format('%I::TEXT::%s', a_new.attname, format_type(a_new.atttypid, a_new.atttypmod)) END, + ', ' ORDER BY a_new.attnum + ), + CASE WHEN bool_or(a_new.attidentity = 'a') THEN 'OVERRIDING SYSTEM VALUE' ELSE '' END + INTO _columns, _values, _overriding + FROM pg_attribute a_new + JOIN pg_attribute a_old ON a_old.attrelid = _table.table_old AND a_old.attname = a_new.attname AND a_old.attnum > 0 AND NOT a_old.attisdropped + WHERE a_new.attrelid = _table.table_new AND a_new.attnum > 0 AND NOT a_new.attisdropped AND a_new.attgenerated = ''; + + EXECUTE format('INSERT INTO %s (%s) %s SELECT %s FROM %s', _table.table_new::regclass, _columns, _overriding, _values, _table.table_old); + GET DIAGNOSTICS _count = ROW_COUNT; + + SELECT string_agg(a_old.attname, ', ' ORDER BY a_old.attnum) INTO _left_behind + FROM pg_attribute a_old + WHERE a_old.attrelid = _table.table_old AND a_old.attnum > 0 AND NOT a_old.attisdropped + AND NOT EXISTS (SELECT 1 FROM pg_attribute a_new WHERE a_new.attrelid = _table.table_new AND a_new.attname = a_old.attname AND NOT a_new.attisdropped); + + RAISE NOTICE '%.%: % rows%', _table.schema_name, _table.table_name, _count, CASE WHEN _left_behind IS NULL THEN '' ELSE ', left behind: ' || _left_behind END; + END LOOP; + + FOR _table IN + SELECT n.nspname AS schema_name, c.relname AS table_name + FROM pg_class c + JOIN pg_namespace n ON n.oid = c.relnamespace + WHERE n.nspname IN ('vibetype_old', 'vibetype_private_old') AND c.relkind IN ('r', 'p') + AND to_regclass(format('%I.%I', left(n.nspname, -4), c.relname)) IS NULL + LOOP + RAISE NOTICE '%.%: removed by the major, left behind', _table.schema_name, _table.table_name; + END LOOP; + + -- the copy wrote explicit ids, so sequences have to continue after them + FOR _table IN + SELECT s.oid AS sequence_name, a.attrelid::regclass AS table_name, a.attname AS column_name + FROM pg_class s + JOIN pg_depend d ON d.objid = s.oid AND d.deptype IN ('a', 'i') + JOIN pg_attribute a ON a.attrelid = d.refobjid AND a.attnum = d.refobjsubid + JOIN pg_namespace n ON n.oid = s.relnamespace + WHERE s.relkind = 'S' AND n.nspname IN ('vibetype', 'vibetype_private') + LOOP + EXECUTE format('SELECT setval(%L, COALESCE((SELECT max(%I) FROM %s), 0) + 1, false)', _table.sequence_name::regclass, _table.column_name, _table.table_name); + END LOOP; +END +$$; + +-- Foreign keys were not checked while copying, so rows referencing nothing would otherwise go unnoticed. +DO $$ +DECLARE + _constraint RECORD; + _orphans BIGINT; +BEGIN + FOR _constraint IN + SELECT + c.conname, + c.conrelid::regclass AS table_child, + c.confrelid::regclass AS table_parent, + (SELECT string_agg(format('child.%I IS NOT NULL', a.attname), ' AND ') FROM unnest(c.conkey) AS k(attnum) JOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = k.attnum) AS condition_present, + (SELECT string_agg(format('parent.%I = child.%I', ap.attname, ac.attname), ' AND ') FROM unnest(c.conkey, c.confkey) AS k(attnum_child, attnum_parent) JOIN pg_attribute ac ON ac.attrelid = c.conrelid AND ac.attnum = k.attnum_child JOIN pg_attribute ap ON ap.attrelid = c.confrelid AND ap.attnum = k.attnum_parent) AS condition_match + FROM pg_constraint c + JOIN pg_namespace n ON n.oid = c.connamespace + WHERE c.contype = 'f' AND n.nspname IN ('vibetype', 'vibetype_private') + LOOP + EXECUTE format('SELECT count(*) FROM %s AS child WHERE %s AND NOT EXISTS (SELECT 1 FROM %s AS parent WHERE %s)', _constraint.table_child, _constraint.condition_present, _constraint.table_parent, _constraint.condition_match) + INTO _orphans; + + IF _orphans > 0 THEN + RAISE EXCEPTION '%: % rows reference no row in %', _constraint.conname, _orphans, _constraint.table_parent; + END IF; + END LOOP; +END +$$; + +ALTER TABLE vibetype_old.contact DROP COLUMN email_addresses; + +-- Specific to sqitch 14: the guest counts of events count seats, each guest plus their approved companions, and `guest_count_accepted` is new. +-- Its triggers were skipped by the copy, so both counters are computed from the copied guests. +UPDATE vibetype.event e +SET (guest_count, guest_count_accepted) = ( + SELECT + COALESCE(SUM(1 + g.companion_count), 0), + COALESCE(SUM(1 + g.companion_count) FILTER (WHERE COALESCE(g.feedback_override, g.feedback) = 'accepted'), 0) + FROM vibetype.guest g + WHERE g.event_id = e.id +); + +-- Specific to sqitch 14: `published_at` is new, so the copy filled it with the time of the upgrade. +-- Every existing event was visible from its creation on, so that is when it counts as published. +UPDATE vibetype.event SET published_at = created_at; + +-- Specific to sqitch 14: derived data is written by triggers, which the copy skipped. +-- Firing only that trigger leaves the metadata, audit and notification triggers out of it. +ALTER TABLE vibetype.event ENABLE ALWAYS TRIGGER search_vector; +UPDATE vibetype.event SET name = name; +ALTER TABLE vibetype.event ENABLE TRIGGER search_vector; + +COMMIT; diff --git a/docs/sqitch-major-upgrade-rehearse.sh b/docs/sqitch-major-upgrade-rehearse.sh index 4164e2fc..0b641285 100755 --- a/docs/sqitch-major-upgrade-rehearse.sh +++ b/docs/sqitch-major-upgrade-rehearse.sh @@ -58,6 +58,9 @@ until docker exec "$NAME" pg_isready -q -h 127.0.0.1 -U postgres -d vibetype 2> sleep 1 done +# Majors before 14 expect PostGIS, which the `postgis/postgis` image created on initialization, so an empty database needs it before the old deploy. +psql -c 'CREATE EXTENSION IF NOT EXISTS postgis' + echo "Deploying $OLD..." sqitch "$OLD" > /dev/null diff --git a/docs/sqitch-major-upgrade.md b/docs/sqitch-major-upgrade.md index 86d4bbd9..a863ad41 100644 --- a/docs/sqitch-major-upgrade.md +++ b/docs/sqitch-major-upgrade.md @@ -5,13 +5,14 @@ Its plan no longer matches the change history recorded in a database deployed by The database therefore goes through a dump, upgrade and restore cycle, and the stack release that pins the new `sqitch` major is a major release itself. The procedure below keeps the data in the same database instead of round-tripping it through a file. -The old schemas are renamed out of the way, the new major deploys fresh schemas next to them, and `sqitch-major-upgrade-.sql` copies the data across, currently [`sqitch-major-upgrade-13.sql`](sqitch-major-upgrade-13.sql). +The old schemas are renamed out of the way, the new major deploys fresh schemas next to them, and `sqitch-major-upgrade-.sql` copies the data across, currently [`sqitch-major-upgrade-14.sql`](sqitch-major-upgrade-14.sql). Its copy is generic, while the parts marked as specific to a major fix data the new rules reject and rebuild derived data, so the next major starts from a copy of the file with those parts replaced. The copy takes only the columns both generations share, so a column the major dropped, or one that was applied by hand and never made it into a release, is reported and left behind instead of failing the restore. ## Before you start The new stack release has to be tagged and pin the new `sqitch`, `postgraphile` and `vibetype` versions together, as the GraphQL API changes with the schema. +Production has to run the last release of the previous `sqitch` major first, as it fixes the rows that the new major's rules reject, like usernames that differ only in case before `sqitch` 14. Never deploy that release the usual way before following this procedure: its `sqitch` fails on the old database, and the new `vibetype` then runs against the old schema. Plan for downtime: the application is unavailable from the first step until the last. @@ -82,7 +83,7 @@ psql_vibetype() { 5. Copy the data: ```sh - psql_vibetype < docs/sqitch-major-upgrade-13.sql + psql_vibetype < docs/sqitch-major-upgrade-14.sql ``` It prints one line per table with the number of rows copied and the columns left behind, and lists tables the major removed. @@ -90,9 +91,11 @@ psql_vibetype() { A row that violates a constraint the major introduced aborts the copy and names the table and value. Fix that row in the `_old` schema, then run the script again. - Contacts with neither a linked account nor an email address violate the `contact_identity_check` of `sqitch` 13. - The script gives them their creator's email address with a `+vibetype` tag, like `name+vibetype@example.com`, so invitations to them reach the creator. - It writes that address into the `_old` schema too, where it stays after a rollback. + `sqitch` 14 drops the `unlisted` event visibility, so the script stores events created as unlisted since `sqitch` 13.10.2 as private, which behaves the same. + It writes that change into the `_old` schema too, where it stays after a rollback. + It also sets the new `published_at` of every existing event to the event's creation time, as all of them were visible from then on. + A contact's email address becomes the only entry of its new list of email addresses, so the copy reports `email_address` as left behind while its value moved. + The guest counts of events are computed again from the copied guests, as `sqitch` 14 counts seats and adds the count of accepted guests. 6. Deploy the full release, which scales the stopped services back up against the new schema: