File obs-server-2.10-0020-ci-Don-t-distinguish-between-text-and-mediumtext.patch of Package obs-server

From 4bac9b2d5d6906a7d93960deebf0f2382537ef02 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Tue, 11 May 2021 23:20:00 +0100
Subject: [PATCH] [ci] Don't distinguish between text and mediumtext.

Some text fields are created as mediumtext in MariaDB as a result
of migrations when using Rails 6.0.

This change makes the script that compares database schema files
not distinguish between text and mediumtext.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/api/script/compare_structure_sql.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/api/script/compare_structure_sql.sh b/src/api/script/compare_structure_sql.sh
index ea89cb3fc5..894c474f34 100755
--- a/src/api/script/compare_structure_sql.sh
+++ b/src/api/script/compare_structure_sql.sh
@@ -25,6 +25,9 @@ for file in "$git_file" "$migrate_file"; do
   # https://mariadb.com/kb/en/library/show-create-table/
   # TODO: drop this line when we drop support for Mariadb < 10.2.2 (SLE12 & Leap 42.3)
   sed -r -i "s/(\`[a-zA-Z0-9_]*\` (medium)*text\s*[a-zA-Z0-9_ ]*) DEFAULT NULL,/\1,/g" "${file}.normalized" || exit 1
+
+  # Don't distinguish between text and mediumtext
+  sed -r -i "s/(\`[a-zA-Z0-9_]*\`) mediumtext/\1 text/g" "${file}.normalized" || exit 1
 done
 
 if ! diff "${git_file}.normalized" "${migrate_file}.normalized"; then
-- 
2.31.1