From 02bfff986887aa1a4905ed247f2ce922b0b4fbd5 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Mon, 12 Aug 2024 16:18:17 +0200 Subject: [PATCH 1/2] Update Mattermost version to 9.11.0 --- build-images.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-images.sh b/build-images.sh index 1c55d56..e4310b8 100755 --- a/build-images.sh +++ b/build-images.sh @@ -3,7 +3,7 @@ # Terminate on error set -e -MATTERMOST_VERSION=8.1.13 +MATTERMOST_VERSION=9.11.0 # Prepare variables for later use images=() From b3bbb96bb487e343a3a746e74471a603148b65a2 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Mon, 12 Aug 2024 16:47:17 +0200 Subject: [PATCH 2/2] Add database upgrade script for Mattermost version 9.11.0 --- imageroot/update-module.d/10database_upgrade | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 imageroot/update-module.d/10database_upgrade diff --git a/imageroot/update-module.d/10database_upgrade b/imageroot/update-module.d/10database_upgrade new file mode 100755 index 0000000..0581cf0 --- /dev/null +++ b/imageroot/update-module.d/10database_upgrade @@ -0,0 +1,30 @@ +#!/bin/bash + +# +# Copyright (C) 2024 Nethesis S.r.l. +# SPDX-License-Identifier: GPL-3.0-or-later +# + +# redirect the standard output to the standard error +exec 1>&2 + +# check upgrade requirement : https://docs.mattermost.com/upgrade/important-upgrade-notes.html +# fix for database upgrade from 8.1.13 to 9.11.0 + +# test if the postgres-app is active +if ! systemctl is-active -q --user postgres-app.service; then + echo "Postgres service is not active, exiting" + exit 0 +fi + +echo "Postgres service is active, we start database upgrade to 9.11.0" + +podman exec -i postgres-app bash -c ' +PGPASSWORD="Nethesis,1234" psql -U mattuser -d mattermost -c " +CREATE TABLE IF NOT EXISTS retentionidsfordeletion ( + id varchar(26) PRIMARY KEY, + tablename varchar(64), + ids varchar(26)[] +); +CREATE INDEX IF NOT EXISTS idx_retentionidsfordeletion_tablename ON retentionidsfordeletion (tablename); +"'