diff --git a/database/update/db-update-2019-06-05.sh b/database/update/db-update-2019-06-05.sh new file mode 100755 index 0000000..0a806d5 --- /dev/null +++ b/database/update/db-update-2019-06-05.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +#myname=`basename $0 .sh` +myname=`basename $0` +myname=${myname%%.*} + +# Pour Mac OS recent (>=10.10, Yosemite), la syntaxe du SED est differente +# Il faut donc exécuter ce script de la manière suivante : +# ./macos-db-update.sh + + +function abort() { + echo "******************************************************" + echo "!!! Script $0 aborté à cause d'une erreur d'exécution !!!" + echo "******************************************************" + exit 1 +} + + +if [ ! -f ../../config/app.php ] ; then +echo "Vous devez executer ce script depuis le dossier database/update/" +exit 1 +fi + + +# Get login, pass, dbname, and hostname +username=$(grep "/\*d\*/'username'" ../../config/app.php | cut -d"'" -f4) || abort +password=$(grep "/\*d\*/'password'" ../../config/app.php | cut -d"'" -f4) || abort +database=$(grep "/\*d\*/'database'" ../../config/app.php | cut -d"'" -f4) || abort +host=$(grep "/\*d\*/'host'" ../../config/app.php | cut -d"'" -f4) || abort + + +#cp -p ./script_sql/db-update-2016-07-01-irap.sql ./script_sql/db-update-2016-07-01-irap-build.sql +cp -p ./script_sql/$myname.sql ./script_sql/$myname-build.sql || abort + +# Execute sql update script +sed -e "s/database/$database/" -i ./script_sql/$myname-build.sql || abort +mysql --user=$username --password=$password -h $host < ./script_sql/$myname-build.sql || abort + +# Delete temporary file and cakephp cache (-f avoids warning if no file) +rm -f ./script_sql/$myname-build.sql +sudo rm -f ../../tmp/cache/models/* +sudo rm -f ../../tmp/cache/persistent/* + +# Faire ca aussi si ca suffit pas... +#sudo chmod -R 777 ../../tmp +#sudo chmod -R 777 ../../vendor +#sudo chmod -R 777 ../../webroot + + +# PLUGIN update +# Installation plugin cakephp-dompdf +# (on va a la racine du projet) +#cd ../../ +#php composer.phar require daoandco/cakephp-dompdf +#bin/cake plugin assets symlink +#cd - diff --git a/database/update/script_sql/db-update-2019-06-05.sql b/database/update/script_sql/db-update-2019-06-05.sql new file mode 100755 index 0000000..97b104b --- /dev/null +++ b/database/update/script_sql/db-update-2019-06-05.sql @@ -0,0 +1,3 @@ +use database; + +update configurations set ldap_cached = 0; \ No newline at end of file -- libgit2 0.21.2