Files
azerothcore-wotlk/apps/ci/ci-pending.sh
Kitzunu 099517161c refactor(DB/Misc): Improve loading time (#15433)
* refactor(DB/Misc): Improve loading time

* NOTE: Running these SQL files can take several minutes (up to 30minutes depending on your system!)

* This will improve loading time over 50%

* comment out error on editing broadcast_text tables

* Update data/sql/updates/pending_db_world/rev_1679045387127819800.sql
2023-04-23 18:00:51 -03:00

38 lines
1.1 KiB
Bash

#!/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 "broadcast_text"); then
echo "> broadcast_text check - Failed"
echo " - DON'T EDIT broadcast_text TABLE UNLESS YOU KNOW WHAT YOU ARE DOING!"
echo " - This error can safely be ignored if the changes are approved to be sniffed."
# exit 1
else
echo "> broadcast_text check - OK"
fi
done
echo
echo "Everything looks good"