<commit_before>
currentdir=${PWD##*/}

# faux sudo car sinon la commande "sudo -n -u" ne le demande pas
sudo ls

. ../../config/settings.ini

touch ../../var/log/migration_2.0.1_to_2.1.0.log

# retour a la racine
cd ../../

# Make sure root cannot run our script
if [ "$(id -u)" == "0" ]; then
   echo "This script must NOT be run as root" 1>&2
   exit 1
fi

mkdir -p /tmp/geonature

echo "Upgrade database schema"
export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f data/migration/2.0.1to2.1.0.sql &> var/log/migration_2.0.1_to_2.1.0.log

echo "Creating 'gn_sensitivity' schema"
export PGPASSWORD=$user_pg_pass;psql -h $db_host -U $user_pg -d $db_name -f data/core/sensitivity.sql &>> var/log/migration_2.0.1_to_2.1.0.log
echo "Insert 'gn_sensitivity' data"
wget --cache=off https://geonature.fr/data/inpn/sensitivity/181201_referentiel_donnes_sensibles.csv -P tmp/geonature
sudo -n -u postgres -s psql -d $db_name -f data/core/sensitivity_data.sql &>> var/log/migration_2.0.1_to_2.1.0.log


# si no grid on exit
if [ "$1" = 'no-grid' ];
  then
  exit 1
fi



# insertion des mailles
echo "Insert INPN grids"
echo "" &>> var/log/migration_2.0.1_to_2.1.0.log
echo "" &>> var/log/migration_2.0.1_to_2.1.0.log
echo "--------------------" &>> var/log/migration_2.0.1_to_2.1.0.log<commit_msg>correction script SQL<commit_after>
currentdir=${PWD##*/}

# faux sudo car sinon la commande "sudo -n -u" ne le demande pas
sudo ls

. ../../config/settings.ini

touch ../../var/log/migration_2.0.1_to_2.1.0.log

# retour a la racine
cd ../../

# Make sure root cannot run our script
if [ "$(id -u)" == "0" ]; then
   echo "This script must NOT be run as root" 1>&2
   exit 1
fi

mkdir -p /tmp/geonature

echo "Upgrade database schema"
export PGPASSWORD=$<PASSWORD>;psql -h $db_host -U $user_pg -d $db_name -f data/migrations/2.0.1to2.1.0.sql &> var/log/migration_2.0.1_to_2.1.0.log

echo "Creating 'gn_sensitivity' schema"
export PGPASSWORD=$<PASSWORD>;psql -h $db_host -U $user_pg -d $db_name -f data/core/sensitivity.sql &>> var/log/migration_2.0.1_to_2.1.0.log
echo "Insert 'gn_sensitivity' data"
wget --cache=off https://geonature.fr/data/inpn/sensitivity/181201_referentiel_donnes_sensibles.csv -P tmp/geonature
sudo -n -u postgres -s psql -d $db_name -f data/core/sensitivity_data.sql &>> var/log/migration_2.0.1_to_2.1.0.log


# si no grid on exit
if [ "$1" = 'no-grid' ];
  then
  exit 1
fi



# insertion des mailles
echo "Insert INPN grids"
echo "" &>> var/log/migration_2.0.1_to_2.1.0.log
echo "" &>> var/log/migration_2.0.1_to_2.1.0.log
echo "--------------------" &>> var/log/migration_2.0.1_to_2.1.0.log
{'fraction_non_alphanumeric': 0.17497147204260174, 'fraction_numerical': 0.045644731837200456, 'mean_word_length': 3.248788368336026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5501934', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1100, 'n_words': 259}