summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorKargatum <dowlandtop@yandex.com>2021-11-02 20:44:17 +0700
committerGitHub <noreply@github.com>2021-11-02 14:44:17 +0100
commit2d38f36555e59e00131c5813da7b300a0a85179a (patch)
treeb93dc38cd96f2870072f70ecc3a4794592ae8426 /apps
parent58a04d12c7e0f694f6ad4cb00dd465f41f647471 (diff)
feat(CI/CheckPending): add check version db line (#8653)
Diffstat (limited to 'apps')
-rw-r--r--apps/ci/ci-pending.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/ci/ci-pending.sh b/apps/ci/ci-pending.sh
new file mode 100644
index 0000000000..2b07719cb4
--- /dev/null
+++ b/apps/ci/ci-pending.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+
+echo "Pending SQL check script:"
+echo
+
+for i in `find data/sql/updates/pending* -name "*.sql" -type f`; do
+ if $(cat "$i"|sed "s/'.*'\(.*\)/\1/g"|grep -q -i -E "(PROCEDURE|FUNCTION)"); then
+ echo "> PROCEDURE check - Failed"
+ exit 1
+ else
+ echo "> PROCEDURE check - OK"
+ fi
+done
+
+for i in `find data/sql/updates/pending* -name "*.sql" -type f`; do
+ if [[ $(cat "$i"|sed 's/ --[^--]*$//'|tr -d '\n'|tr -d " "|tail -c 1) != ";" ]]; then
+ echo "Missing Semicolon (;) or multiple newlines at the end of the file."
+ exit 1
+ else
+ echo "> Semicolon check - OK"
+ fi
+done
+
+for i in `find data/sql/updates/pending* -name "*.sql" -type f`; do
+ if $(cat "$i"|sed "s/'.*'\(.*\)/\1/g"|grep -q -i -E "version_db_"); then
+ echo "> version_db check - OK"
+ else
+ echo "> version_db check - Failed"
+ exit 1
+ fi
+done
+
+echo
+echo "Everything looks good"