From 4de568edeca3a31750b99a539828706eaff1ff2e Mon Sep 17 00:00:00 2001
From: Timm Fitschen <t.fitschen@indiscale.com>
Date: Sun, 20 Jun 2021 22:19:09 +0200
Subject: [PATCH] fix version of patch

---
 CHANGELOG.md                                           |  5 ++++-
 .../drop_rules_table.sql                               |  0
 .../patch.sh                                           | 10 +++++-----
 utils/update_sql_procedures.sh                         |  2 +-
 4 files changed, 10 insertions(+), 7 deletions(-)
 rename patches/{patch20210621-4.0.1 => patch20210621-5.0.0}/drop_rules_table.sql (100%)
 rename patches/{patch20210621-4.0.1 => patch20210621-5.0.0}/patch.sh (92%)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index a43efa2..bcd95e5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
-## [Unreleased] ##
+## [Unreleased (5.x.x)] ##
 
 ### Added ###
 
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ### Removed ###
 
+* `getRules` procedure and the `rules` table. The jobs rules are being
+  configured in the server repository now.
+
 ### Fixed ###
 
 ### Security ###
diff --git a/patches/patch20210621-4.0.1/drop_rules_table.sql b/patches/patch20210621-5.0.0/drop_rules_table.sql
similarity index 100%
rename from patches/patch20210621-4.0.1/drop_rules_table.sql
rename to patches/patch20210621-5.0.0/drop_rules_table.sql
diff --git a/patches/patch20210621-4.0.1/patch.sh b/patches/patch20210621-5.0.0/patch.sh
similarity index 92%
rename from patches/patch20210621-4.0.1/patch.sh
rename to patches/patch20210621-5.0.0/patch.sh
index 86a6d0b..1e9c53b 100755
--- a/patches/patch20210621-4.0.1/patch.sh
+++ b/patches/patch20210621-5.0.0/patch.sh
@@ -1,6 +1,5 @@
 #!/bin/bash
 #
-# ** header v3.0
 # This file is a part of the CaosDB Project.
 #
 # Copyright (C) 2018 Research Group Biomedical Physics,
@@ -21,10 +20,11 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program. If not, see <https://www.gnu.org/licenses/>.
 #
-# ** end header
-#
-# Update mysql schema to version v4.0.0-rc1
-NEW_VERSION="v4.0.1"
+
+# Update mysql schema to version v5.0.0
+# Drop the 'rules' table.
+
+NEW_VERSION="v5.0.0"
 OLD_VERSION="v4.0.0"
 
 if [ -z "$UTILSPATH" ]; then
diff --git a/utils/update_sql_procedures.sh b/utils/update_sql_procedures.sh
index 9398a33..06c07f9 100755
--- a/utils/update_sql_procedures.sh
+++ b/utils/update_sql_procedures.sh
@@ -38,7 +38,7 @@ source $UTILSPATH/load_settings.sh
 source $UTILSPATH/helpers.sh
 
 echo -n "updating procedures ... "
-temp_proc_sql=$(tempfile --suffix=.sql)
+temp_proc_sql=$(mktemp --suffix=.sql)
 sed -e "s/db_2_0/$DATABASE_NAME/g" procedures/*.sql procedures/query/*.sql \
     > "$temp_proc_sql"
 mysql_execute_file "$temp_proc_sql"
-- 
GitLab