diff --git a/app/Config/Routes.php b/app/Config/Routes.php
index 91f02682..76837118 100644
--- a/app/Config/Routes.php
+++ b/app/Config/Routes.php
@@ -30,7 +30,7 @@
$routes->add('documentGet', 'Document::get');
$routes->add('locationChange', 'Location::change');
$routes->post('locationWrite', 'Location::write');
-$routes->add('parametre', '\Ppci\Controllers\Utils\Submenu::index');
+$routes->add('parametre', '\Ppci\Controllers\Utils::submenu/parametre');
$routes->add('icesList', 'Ices::list');
$routes->add('icesChange', 'Ices::change');
$routes->post('icesWrite', 'Ices::write');
@@ -106,3 +106,4 @@
$routes->add('updateparamDisplay', 'Updateparam::display');
$routes->add('updateparamExec', 'Updateparam::exec');
$routes->add('updateparamGettemplate', 'Updateparam::gettemplate');
+$routes->add('aide', '\Ppci\Controllers\Utils::submenu/aide');
\ No newline at end of file
diff --git a/documentation/schema.png b/documentation/schema.png
new file mode 100644
index 00000000..564fc387
Binary files /dev/null and b/documentation/schema.png differ
diff --git a/documentation/sturwild.dbm b/documentation/sturwild.dbm
new file mode 100644
index 00000000..222b28bd
--- /dev/null
+++ b/documentation/sturwild.dbm
@@ -0,0 +1,1871 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/env b/env
index 3601a0b0..e2370367 100644
--- a/env
+++ b/env
@@ -38,13 +38,13 @@ session.expiration = 14400
#--------------------------------------------------------------------
database.default.hostname = localhost
-database.default.database = dbname
-database.default.username = login
-database.default.password = password
+database.default.database = sturwild
+database.default.username = sturwild
+database.default.password = sturwildPassword
database.default.DBDriver = Postgre
database.default.DBPrefix =
database.default.port = 5432
-database.default.searchpath = public,app,gacl
+database.default.searchpath = sturwild,gacl,public
database.default.charset = utf8
# Ppci\Config\Ppci.language = fr
@@ -52,8 +52,8 @@ database.default.charset = utf8
#--------------------------------------------------------------------
# Encryption
#--------------------------------------------------------------------
-# privateKey = ${BASE_DIR}/id_app
-# pubKey = ${BASE_DIR}/id_app.pub
+privateKey = ${BASE_DIR}/id_sturwild
+pubKey = ${BASE_DIR}/id_sturwild.pub
#--------------------------------------------------------------------
# Ppci identification
@@ -183,107 +183,11 @@ Ppci\Config\IdentificationConfig.identificationLogo = "${FRONT_DIR}/favicon.png"
# PPCI MAILS
#--------------------------------------------------------------------
-#APP_mail = mail@mysociety.com
-#MAIL_enabled = 1
+# APP_mail = mail@mysociety.com
+# MAIL_enabled = 1
# MAIL_param.from = mail@mysociety.com
# MAIL_param.mailDebug = 0
# Duration before resend a mail to administrators for the same event (in seconds)
# APP_mailToAdminPeriod = 7200
-
-#--------------------------------------------------------------------
-# CONTENT SECURITY POLICY
-#--------------------------------------------------------------------
-
-# contentsecuritypolicy.reportOnly = false
-# contentsecuritypolicy.defaultSrc = 'none'
-# contentsecuritypolicy.scriptSrc = 'self'
-# contentsecuritypolicy.styleSrc = 'self'
-# contentsecuritypolicy.imageSrc = 'self'
-# contentsecuritypolicy.baseURI = null
-# contentsecuritypolicy.childSrc = null
-# contentsecuritypolicy.connectSrc = 'self'
-# contentsecuritypolicy.fontSrc = null
-# contentsecuritypolicy.formAction = null
-# contentsecuritypolicy.frameAncestors = null
-# contentsecuritypolicy.frameSrc = null
-# contentsecuritypolicy.mediaSrc = null
-# contentsecuritypolicy.objectSrc = null
-# contentsecuritypolicy.pluginTypes = null
-# contentsecuritypolicy.reportURI = null
-# contentsecuritypolicy.sandbox = false
-# contentsecuritypolicy.upgradeInsecureRequests = false
-# contentsecuritypolicy.styleNonceTag = '{csp-style-nonce}'
-# contentsecuritypolicy.scriptNonceTag = '{csp-script-nonce}'
-# contentsecuritypolicy.autoNonce = true
-
-#--------------------------------------------------------------------
-# COOKIE
-#--------------------------------------------------------------------
-
-# cookie.prefix = ''
-# cookie.expires = 0
-# cookie.path = '/'
-# cookie.domain = ''
-# cookie.secure = false
-# cookie.httponly = false
-# cookie.samesite = 'Lax'
-# cookie.raw = false
-
-#--------------------------------------------------------------------
-# ENCRYPTION
-#--------------------------------------------------------------------
-
-# encryption.key =
-# encryption.driver = OpenSSL
-# encryption.blockSize = 16
-# encryption.digest = SHA512
-
-#--------------------------------------------------------------------
-# HONEYPOT
-#--------------------------------------------------------------------
-
-# honeypot.hidden = 'true'
-# honeypot.label = 'Fill This Field'
-# honeypot.name = 'honeypot'
-# honeypot.template = ''
-# honeypot.container = '
{template}
'
-
-#--------------------------------------------------------------------
-# SECURITY
-#--------------------------------------------------------------------
-
-# security.csrfProtection = 'cookie'
-# security.tokenRandomize = false
-# security.tokenName = 'csrf_token_name'
-# security.headerName = 'X-CSRF-TOKEN'
-# security.cookieName = 'csrf_cookie_name'
-# security.expires = 7200
-# security.regenerate = true
-# security.redirect = false
-# security.samesite = 'Lax'
-
-#--------------------------------------------------------------------
-# SESSION
-#--------------------------------------------------------------------
-
-# session.driver = 'CodeIgniter\Session\Handlers\FileHandler'
-# session.cookieName = 'ci_session'
-# session.expiration = 7200
-# session.savePath = null
-# session.matchIP = false
-# session.timeToUpdate = 300
-# session.regenerateDestroy = false
-
-#--------------------------------------------------------------------
-# LOGGER
-#--------------------------------------------------------------------
-
-# logger.threshold = 4
-
-#--------------------------------------------------------------------
-# CURLRequest
-#--------------------------------------------------------------------
-
-# curlrequest.shareOptions = false
diff --git a/install/apache/sturwild.conf b/install/apache/sturwild.conf
new file mode 100644
index 00000000..eae1e06b
--- /dev/null
+++ b/install/apache/sturwild.conf
@@ -0,0 +1,44 @@
+
+ ServerName sturwild.mysociety.com
+ ServerPath /sturwild.mysociety.com
+ RewriteEngine On
+ RewriteRule ^ https://sturwild.mysociety.com%{REQUEST_URI} [R]
+
+
+ ServerName sturwild.mysociety.com
+ ServerPath /sturwild.mysociety.com
+ SSLEngine on
+ SSLCertificateFile /etc/ssl/certs/server.crt
+ SSLCertificateKeyFile /etc/ssl/private/server.key
+ SSLCACertificateFile /etc/ssl/certs/cacert.crt
+ CustomLog /var/log/apache2/sturwild-access.log combined
+ ErrorLog /var/log/apache2/sturwild-error.log
+ DocumentRoot /var/www/sturwildApp/sturwild/public
+
+
+ setenv envPath /var/www/sturwildApp/sturwild
+
+ Deny from all
+
+ Options -Indexes
+ Header unset ETag
+ Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate, private"
+ Header set Pragma "no-cache"
+ Header set X-Frame-Options "DENY"
+ Header set X-XSS-Protection "1; mode=block"
+ Header set X-Content-Type-Options "nosniff"
+ Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
+ Header always set Content-Security-Policy "default-src 'self' ; script-src blob: * 'self' 'unsafe-inline' 'unsafe-eval'; connect-src data: blob: filesystem: *.tile.openstreetmap.org 'self' ; img-src 'self' data: blob: *.openstreetmap.org ; style-src 'self' 'unsafe-inline' ;"
+
+ Header set Cache-Control "max-age=604800, private"
+
+
+ Header set Cache-Control "max-age=2592000, public"
+
+ RewriteEngine On
+ Require all granted
+ RewriteBase /
+ RewriteCond "/%{REQUEST_FILENAME}" !-f
+ RewriteCond "/%{REQUEST_FILENAME}" !-d
+ RewriteRule "(.*)" "/index.php?$1" [PT,QSA]
+
diff --git a/install/deploy_new_instance.sh b/install/deploy_new_instance.sh
new file mode 100755
index 00000000..17457b33
--- /dev/null
+++ b/install/deploy_new_instance.sh
@@ -0,0 +1,124 @@
+#!/bin/bash
+# install a new instance into a server
+# must be executed with login root
+# creation : Eric Quinton - 2017-05-04
+REPO=https://github.com/inrae/sturwild
+PHPVER=8.3
+PHPINIFILE="/etc/php/$PHPVER/apache2/php.ini"
+echo "Installation of Sturwild app "
+echo "This script is available for Debian or Ubuntu server"
+echo "this script will install apache server and php, postgresql and deploy the current version of STURWILD"
+read -p "Do you want to continue [y/n]?" response
+if [ "$response" = "y" ]
+then
+# installing php repository
+apt -y install lsb-release apt-transport-https ca-certificates
+DISTRIBCODE=`lsb_release -sc`
+DISTRIBNAME=`lsb_release -si`
+wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
+if [ $DISTRIBNAME == 'Ubuntu' ]
+then
+apt-get install software-properties-common
+add-apt-repository -y ppa:ondrej/php
+add-apt-repository -y ppa:ondrej/apache2
+elif [ $DISTRIBNAME == 'Debian' ]
+then
+wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
+echo "deb https://packages.sury.org/php/ $DISTRIBCODE main" | tee /etc/apt/sources.list.d/php.list
+fi
+apt-get update
+# installing packages
+apt-get -y install unzip apache2 libapache2-mod-evasive libapache2-mod-php$PHPVER php$PHPVER php$PHPVER-ldap php$PHPVER-pgsql php$PHPVER-mbstring php$PHPVER-xml php$PHPVER-zip php$PHPVER-imagick php$PHPVER-gd php$PHPVER-curl postgresql postgresql-client postgis git
+/usr/sbin/a2enmod ssl
+/usr/sbin/a2enmod headers
+/usr/sbin/a2enmod rewrite
+# chmod -R g+r /etc/ssl/private
+# usermod www-data -a -G ssl-cert
+/usr/sbin/a2ensite default-ssl
+/usr/sbin/a2ensite 000-default
+
+# creation of directory
+cd /var/www
+mkdir sturwildApp
+cd sturwildApp
+
+# download software
+echo "download software"
+git clone https://github.com/inrae/sturwild.git -b main
+
+# update rights on files
+chmod -R 755 sturwild/
+cd sturwild
+# create .env file
+cp env .env
+# creation of database
+echo "creation of the database"
+cd /install
+su postgres -c "psql -f init_by_psql.sql"
+cd ..
+echo "you may verify the configuration of access to postgresql"
+echo "look at /etc/postgresql/11/main/pg_hba.conf (verify your version). Only theses lines must be activate:"
+echo '# "local" is for Unix domain socket connections only
+local all all peer
+# IPv4 local connections:
+host all all 127.0.0.1/32 md5
+# IPv6 local connections:
+host all all ::1/128 md5'
+
+read -p "Enter to continue" answer
+
+# install backup program
+echo "backup configuration - dump at 20:00 into /var/lib/postgresql/backup"
+echo "please, set up a data transfert mechanism to deport them to another medium"
+cp install/pgsql/backup.sh /var/lib/postgresql/
+chown postgres /var/lib/postgresql/backup.sh
+line="0 20 * * * /var/lib/postgresql/backup.sh"
+#(crontab -u postgres -l; echo "$line" ) | crontab -u postgres -
+echo "$line" | crontab -u postgres -
+
+# generate rsa key for encrypted tokens
+echo "generate encryption keys for identification tokens"
+openssl genpkey -algorithm rsa -out id_sturwild -pkeyopt rsa_keygen_bits:2048
+openssl rsa -in id_sturwild -pubout -out id_sturwild.pub
+chown www-data id_sturwild
+
+# update rights to specific software folders
+find . -type d -exec chmod 750 {} \;
+find . -type f -exec chmod 640 {} \;
+chgrp -R www-data .
+chmod -R g+w writable
+
+# adjust php.ini values
+upload_max_filesize="=100M"
+post_max_size="=50M"
+max_execution_time="=120"
+max_input_time="=240"
+memory_limit="=1024M"
+max_input_vars="10000"
+for key in upload_max_filesize post_max_size max_execution_time max_input_time memory_limit
+do
+ sed -i "s/^\($key\).*/\1 $(eval echo \${$key})/" $PHPINIFILE
+done
+sed -i "s/; max_input_vars = .*/max_input_vars=$max_input_vars/" $PHPINIFILE
+
+# adjust imagick policy
+sed -e "s/ / /" /etc/ImageMagick-6/policy.xml > /tmp/policy.xml
+cp /tmp/policy.xml /etc/ImageMagick-6/
+
+# creation of virtual host
+echo "creation of virtual site"
+cp install/apache2/sturwild.conf /etc/apache2/sites-available/
+/usr/sbin/a2ensite sturwild
+echo "you must modify the file /etc/apache2/sites-available/sturwild.conf"
+echo "address of your instance, ssl parameters),"
+echo "then run this command:"
+echo "systemctl reload apache2"
+
+echo ""
+echo "To activate the sending of e-mails, you must install an application as Postfix or msmtp and configure it"
+echo "The configuration is specific of each organization: this script cannot do it, sorry..."
+
+read -p "Enter to terminate" answer
+
+fi
+# end of script
diff --git a/install/init_by_psql.sql b/install/init_by_psql.sql
new file mode 100644
index 00000000..55358fe6
--- /dev/null
+++ b/install/init_by_psql.sql
@@ -0,0 +1,29 @@
+
+CREATE USER sturwild WITH
+ LOGIN
+ NOSUPERUSER
+ INHERIT
+ NOCREATEDB
+ NOCREATEROLE
+ NOREPLICATION
+ PASSWORD 'sturwildPassword'
+;
+
+/*
+ * Database creation
+ */
+create database sturwild owner sturwild;
+\c "dbname=sturwild"
+ create extension if not exists postgis schema public;
+ create extension if not exists pgcrypto schema public;
+
+
+\c "dbname=sturwild user=sturwild password=sturwildPassword host=localhost"
+
+/**
+ * create structure
+ */
+\ir pgsql/createtables.sql
+\ir translatedb/comment_sql.sql
+\ir translatedb/param_en.sql
+
diff --git a/install/pgsql/update24.1-24.2.sql b/install/pgsql/alter_24.0-24.1.sql
similarity index 97%
rename from install/pgsql/update24.1-24.2.sql
rename to install/pgsql/alter_24.0-24.1.sql
index f32e5850..526e9a6f 100644
--- a/install/pgsql/update24.1-24.2.sql
+++ b/install/pgsql/alter_24.0-24.1.sql
@@ -3,7 +3,7 @@ create unique index if not exists dbparamname_idx on dbparam (dbparam_name);
insert into dbparam (dbparam_name, dbparam_value, dbparam_description, dbparam_description_en)
values (
'APPLI_code',
-'APP_code',
+'INSTITUTE-CODE',
'Code de l''application, pour les exportations',
'Code of the application, to export data'
)
diff --git a/install/pgsql/backup.sh b/install/pgsql/backup.sh
new file mode 100755
index 00000000..9ab2a26b
--- /dev/null
+++ b/install/pgsql/backup.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#!This is local_pg_dumpall
+#Script de backup sequentiel avec support des gros blobs des bases postgres
+
+PSQL_VERSION=`psql --version | cut -f 3 -d ' ' | cut -d '.' -f 1`
+DUMPPATH=/var/lib/postgresql/backup
+#cree le repertoire de backup s'il n'existe pas
+if [ ! -d $DUMPPATH ]
+then
+ mkdir -p $DUMPPATH
+ chmod o-r,o-x,o-w $DUMPPATH
+ fi
+# chown -R postgres:postgres $DUMPPATH
+LOG=$DUMPPATH/pgbackup.log
+echo `date` > $LOG
+echo "databases backup - dumpall" >>$LOG
+/usr/bin/pg_dumpall |gzip -c > $DUMPPATH/pg.out.gz 2>>$LOG
+
+# Pour chaque base de données
+LIST=$(psql -tl | cut -d '|' -f1 | grep -v ' : ')
+echo List of databases: $LIST
+
+for DBNAME in $LIST
+ do
+ # Ne backup pas les bases "modèles" de postgresql
+ [ "$DBNAME" = "template0" -o "$DBNAME" = "template1" ] && continue
+
+ # Dump la base :
+ echo -n Dumping "$DBNAME" : >> $LOG
+ if pg_dump --blobs ${DBNAME} | gzip -9 -c >${DUMPPATH}/${DBNAME}.gz; then
+ echo "ok" > /dev/null
+ else
+ rm -f ${DUMPPATH}/${DBNAME}.tgz
+ echo "FAILED!" >>$LOG
+ fi
+ # ajout du vacuum - EQ le 31/8/17
+ vacuumdb -d "$DBNAME" --analyze
+done
+
+cp /etc/postgresql/${PSQL_VERSION}/main/pg_hba.conf ${DUMPPATH}
diff --git a/install/pgsql/createtables.sql b/install/pgsql/createtables.sql
new file mode 100644
index 00000000..8e48a777
--- /dev/null
+++ b/install/pgsql/createtables.sql
@@ -0,0 +1,1651 @@
+-- Database generated with pgModeler (PostgreSQL Database Modeler).
+-- pgModeler version: 1.1.3
+-- PostgreSQL version: 15.0
+-- Project Site: pgmodeler.io
+-- Model Author: ---
+-- -- object: pg_database_owner | type: ROLE --
+-- -- DROP ROLE IF EXISTS pg_database_owner;
+-- CREATE ROLE pg_database_owner WITH
+-- INHERIT
+-- PASSWORD '********';
+-- -- ddl-end --
+--
+
+-- object: sturwild | type: SCHEMA --
+-- DROP SCHEMA IF EXISTS sturwild CASCADE;
+CREATE SCHEMA sturwild;
+-- ddl-end --
+ALTER SCHEMA sturwild OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl | type: SCHEMA --
+-- DROP SCHEMA IF EXISTS sturwildgacl CASCADE;
+CREATE SCHEMA sturwildgacl;
+-- ddl-end --
+ALTER SCHEMA sturwildgacl OWNER TO sturwild;
+-- ddl-end --
+
+SET search_path TO pg_catalog,public,sturwild,sturwildgacl;
+-- ddl-end --
+
+
+-- object: sturwild.capture_state_capture_state_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.capture_state_capture_state_id_seq CASCADE;
+CREATE SEQUENCE sturwild.capture_state_capture_state_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.capture_state_capture_state_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.capture_state | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.capture_state CASCADE;
+CREATE TABLE sturwild.capture_state (
+ capture_state_id integer NOT NULL DEFAULT nextval('sturwild.capture_state_capture_state_id_seq'::regclass),
+ capture_state_name character varying NOT NULL,
+ capture_state_exchange varchar,
+ capture_state_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT capture_etat_pk PRIMARY KEY (capture_state_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.capture_state IS E'Table des états à la capture';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.capture_state.capture_state_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.capture_state OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.capture_method_capture_method_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.capture_method_capture_method_id_seq CASCADE;
+CREATE SEQUENCE sturwild.capture_method_capture_method_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.capture_method_capture_method_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.capture_method | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.capture_method CASCADE;
+CREATE TABLE sturwild.capture_method (
+ capture_method_id integer NOT NULL DEFAULT nextval('sturwild.capture_method_capture_method_id_seq'::regclass),
+ capture_method_name character varying NOT NULL,
+ capture_method_exchange varchar,
+ capture_method_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT capture_mode_pk PRIMARY KEY (capture_method_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.capture_method IS E'Mode de capture des poissons';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.capture_method.capture_method_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.capture_method OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.origin_origin_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.origin_origin_id_seq CASCADE;
+CREATE SEQUENCE sturwild.origin_origin_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.origin_origin_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.origin | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.origin CASCADE;
+CREATE TABLE sturwild.origin (
+ origin_id integer NOT NULL DEFAULT nextval('sturwild.origin_origin_id_seq'::regclass),
+ origin_name character varying NOT NULL,
+ origin_exchange varchar,
+ origin_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT capture_type_pk PRIMARY KEY (origin_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.origin IS E'Type de capture (professionnelle, amateur, scientifique...)';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.origin.origin_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.origin OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.ices_ices_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.ices_ices_id_seq CASCADE;
+CREATE SEQUENCE sturwild.ices_ices_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.ices_ices_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.ices | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.ices CASCADE;
+CREATE TABLE sturwild.ices (
+ ices_id integer NOT NULL DEFAULT nextval('sturwild.ices_ices_id_seq'::regclass),
+ ices_name character varying NOT NULL,
+ CONSTRAINT ciem_pk PRIMARY KEY (ices_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.ices IS E'Table des zones de peche CIEM';
+-- ddl-end --
+ALTER TABLE sturwild.ices OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.dbparam_dbparam_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.dbparam_dbparam_id_seq CASCADE;
+CREATE SEQUENCE sturwild.dbparam_dbparam_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.dbparam_dbparam_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.dbparam | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.dbparam CASCADE;
+CREATE TABLE sturwild.dbparam (
+ dbparam_id integer NOT NULL DEFAULT nextval('sturwild.dbparam_dbparam_id_seq'::regclass),
+ dbparam_name character varying NOT NULL,
+ dbparam_value character varying,
+ CONSTRAINT dbparam_pk PRIMARY KEY (dbparam_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.dbparam IS E'Table of parameters intrinsically associated to the instance';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.dbparam.dbparam_name IS E'Name of the parameter';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.dbparam.dbparam_value IS E'Value of the parameter';
+-- ddl-end --
+ALTER TABLE sturwild.dbparam OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwild.dbparam (dbparam_name, dbparam_value) VALUES (E'APPLI_code', E'sturwild');
+-- ddl-end --
+INSERT INTO sturwild.dbparam (dbparam_name, dbparam_value) VALUES (E'APPLI_title', E'STURWILD');
+-- ddl-end --
+INSERT INTO sturwild.dbparam (dbparam_name, dbparam_value) VALUES (E'mapDefaultX', E'-0.70');
+-- ddl-end --
+INSERT INTO sturwild.dbparam (dbparam_name, dbparam_value) VALUES (E'mapDefaultY', E'44.77');
+-- ddl-end --
+INSERT INTO sturwild.dbparam (dbparam_name, dbparam_value) VALUES (E'mapDefaultZoom', E'7');
+-- ddl-end --
+INSERT INTO sturwild.dbparam (dbparam_name, dbparam_value) VALUES (E'otp_issuer', E'sturwild.society.com');
+-- ddl-end --
+
+-- object: sturwild.dbversion_dbversion_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.dbversion_dbversion_id_seq CASCADE;
+CREATE SEQUENCE sturwild.dbversion_dbversion_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.dbversion_dbversion_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.dbversion | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.dbversion CASCADE;
+CREATE TABLE sturwild.dbversion (
+ dbversion_id integer NOT NULL DEFAULT nextval('sturwild.dbversion_dbversion_id_seq'::regclass),
+ dbversion_number character varying NOT NULL,
+ dbversion_date timestamp NOT NULL,
+ CONSTRAINT dbversion_pk PRIMARY KEY (dbversion_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.dbversion IS E'Table des versions de la base de donnees';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.dbversion.dbversion_number IS E'Numero de la version';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.dbversion.dbversion_date IS E'Date de la version';
+-- ddl-end --
+ALTER TABLE sturwild.dbversion OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwild.dbversion (dbversion_number, dbversion_date) VALUES (E'24.0', E'2024-02-05');
+-- ddl-end --
+
+-- object: sturwild.declaration_declaration_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.declaration_declaration_id_seq CASCADE;
+CREATE SEQUENCE sturwild.declaration_declaration_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.declaration_declaration_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.declaration | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.declaration CASCADE;
+CREATE TABLE sturwild.declaration (
+ declaration_id integer NOT NULL DEFAULT nextval('sturwild.declaration_declaration_id_seq'::regclass),
+ status_id integer NOT NULL,
+ capture_method_id integer,
+ origin_id integer NOT NULL,
+ gear_type_id integer,
+ species_id integer,
+ capture_state_id integer,
+ fate_id integer,
+ capture_date timestamp,
+ year integer NOT NULL,
+ caught_number integer NOT NULL DEFAULT 1,
+ estimated_capture_date character varying,
+ gear_mesh character varying,
+ target_species character varying,
+ depth real,
+ depth_min real,
+ depth_max real,
+ length_min real,
+ length_max real,
+ weight_min real,
+ weight_max real,
+ fisher_code character varying,
+ contact character varying,
+ contact_coordinates character varying,
+ harbour_vessel character varying,
+ declaration_mode character varying,
+ remarks character varying,
+ handling character varying,
+ identification_quality smallint NOT NULL DEFAULT 1,
+ declaration_uuid uuid NOT NULL DEFAULT gen_random_uuid(),
+ origin_identifier varchar,
+ target_species_id integer,
+ institute_id integer,
+ CONSTRAINT capture_id PRIMARY KEY (declaration_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.declaration IS E'Informations liées à la déclaration.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.declaration_id IS E'Identifiant de la capture.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.species_id IS E'Identifiant de l''espèce';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.capture_date IS E'Date de capture.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.year IS E'Année de pêche';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.caught_number IS E'Nombre d''individu capturés';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.estimated_capture_date IS E'Estimation de la date de capture.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.gear_mesh IS E'Maille du filet, le cas échéant';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.target_species IS E'Espece normalement ciblée lors de la pêche.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.depth IS E'Profondeur de pêche, en mètres';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.depth_min IS E'Profondeur minimum de pêche, en mètres';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.depth_max IS E'Profondeur maximale de pêche, en mètres';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.length_min IS E'longueur totale minimale, en mm';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.length_max IS E'Longueur totale maximale, en mm';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.weight_min IS E'Masse minimale en kg';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.weight_max IS E'Masse maximale en kg';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.fisher_code IS E'Code du pêcheur';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.contact IS E'Autre interlocuteur';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.contact_coordinates IS E'Coordonnées de l''autre interlocuteur';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.harbour_vessel IS E'Port d''attache du navire de pêche';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.remarks IS E'Observations générales';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.handling IS E'Manipulation post-capture du lot capturé';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.identification_quality IS E'0 : identification de l''espèce incertaine\n1 : identification sûre';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.declaration_uuid IS E'UUID of the declaration';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.declaration.origin_identifier IS E'Identifier of the declaration into the origin database. Must be filled in to import declarations with fishes';
+-- ddl-end --
+ALTER TABLE sturwild.declaration OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.fate_fate_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.fate_fate_id_seq CASCADE;
+CREATE SEQUENCE sturwild.fate_fate_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.fate_fate_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.fate | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.fate CASCADE;
+CREATE TABLE sturwild.fate (
+ fate_id integer NOT NULL DEFAULT nextval('sturwild.fate_fate_id_seq'::regclass),
+ fate_name character varying NOT NULL,
+ fate_exchange varchar,
+ fate_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT devenir_pk PRIMARY KEY (fate_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.fate IS E'Devenir des esturgeons capturés';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fate.fate_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.fate OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.document_document_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.document_document_id_seq CASCADE;
+CREATE SEQUENCE sturwild.document_document_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.document_document_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.document | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.document CASCADE;
+CREATE TABLE sturwild.document (
+ document_id integer NOT NULL DEFAULT nextval('sturwild.document_document_id_seq'::regclass),
+ mime_type_id integer NOT NULL,
+ document_date_import date NOT NULL,
+ document_name character varying NOT NULL,
+ document_description character varying,
+ data bytea,
+ size integer,
+ thumbnail bytea,
+ fish_id integer NOT NULL,
+ document_uuid uuid NOT NULL DEFAULT gen_random_uuid(),
+ CONSTRAINT document_pk PRIMARY KEY (document_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.document IS E'Documents numériques rattachés à un poisson ou à un événement';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.document.document_name IS E'Nom d''origine du document';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.document.document_description IS E'Description libre du document';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.document.document_uuid IS E'UUID of the document';
+-- ddl-end --
+ALTER TABLE sturwild.document OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.gear_type_gear_type_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.gear_type_gear_type_id_seq CASCADE;
+CREATE SEQUENCE sturwild.gear_type_gear_type_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.gear_type_gear_type_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.gear_type | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.gear_type CASCADE;
+CREATE TABLE sturwild.gear_type (
+ gear_type_id integer NOT NULL DEFAULT nextval('sturwild.gear_type_gear_type_id_seq'::regclass),
+ gear_type_name character varying NOT NULL,
+ gear_type_exchange varchar,
+ gear_type_order smallint NOT NULL DEFAULT 99,
+ CONSTRAINT engin_type_pk PRIMARY KEY (gear_type_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.gear_type IS E'Table des engins utilisés';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.gear_type.gear_type_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.gear_type OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.species_species_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.species_species_id_seq CASCADE;
+CREATE SEQUENCE sturwild.species_species_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.species_species_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.species | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.species CASCADE;
+CREATE TABLE sturwild.species (
+ species_id integer NOT NULL DEFAULT nextval('sturwild.species_species_id_seq'::regclass),
+ species_name character varying,
+ species_exchange varchar,
+ species_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT espece_id PRIMARY KEY (species_id)
+);
+-- ddl-end --
+COMMENT ON COLUMN sturwild.species.species_id IS E'Identifiant de l''espèce';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.species.species_name IS E'Nom complet de l''espèce.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.species.species_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.species OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.estuaire_area_id_0_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.estuaire_area_id_0_seq CASCADE;
+CREATE SEQUENCE sturwild.estuaire_area_id_0_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 2147483647
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.estuaire_area_id_0_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.event_event_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.event_event_id_seq CASCADE;
+CREATE SEQUENCE sturwild.event_event_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.event_event_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.event | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.event CASCADE;
+CREATE TABLE sturwild.event (
+ event_id integer NOT NULL DEFAULT nextval('sturwild.event_event_id_seq'::regclass),
+ declaration_id integer,
+ event_type_id integer NOT NULL,
+ event_date timestamp,
+ event_remarks character varying,
+ login character varying,
+ CONSTRAINT evenement_id PRIMARY KEY (event_id)
+);
+-- ddl-end --
+COMMENT ON COLUMN sturwild.event.event_remarks IS E'Commentaire général sur l''événement';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.event.login IS E'Login de la personne ayant créé l''événement';
+-- ddl-end --
+ALTER TABLE sturwild.event OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.event_type_event_type_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.event_type_event_type_id_seq CASCADE;
+CREATE SEQUENCE sturwild.event_type_event_type_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.event_type_event_type_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.event_type | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.event_type CASCADE;
+CREATE TABLE sturwild.event_type (
+ event_type_id integer NOT NULL DEFAULT nextval('sturwild.event_type_event_type_id_seq'::regclass),
+ event_type_name character varying NOT NULL,
+ event_type_exchange varchar,
+ event_type_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT evenement_type_pk PRIMARY KEY (event_type_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.event_type IS E'Types d''événements possibles sur une déclaration';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.event_type.event_type_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.event_type OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.fish_fish_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.fish_fish_id_seq CASCADE;
+CREATE SEQUENCE sturwild.fish_fish_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.fish_fish_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.fish | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.fish CASCADE;
+CREATE TABLE sturwild.fish (
+ fish_id integer NOT NULL DEFAULT nextval('sturwild.fish_fish_id_seq'::regclass),
+ declaration_id integer NOT NULL,
+ species_id integer,
+ tag_presence_id integer,
+ capture_state_id integer,
+ fate_id integer,
+ weight real,
+ handling character varying,
+ tag_number character varying,
+ fish_length integer,
+ estimated_cohort character varying,
+ validated_cohort smallint,
+ background character varying,
+ remarks character varying,
+ identification_quality smallint NOT NULL DEFAULT 1,
+ fish_uuid uuid NOT NULL DEFAULT gen_random_uuid(),
+ CONSTRAINT individu_id PRIMARY KEY (fish_id)
+);
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.declaration_id IS E'Identifiant de la capture.';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.weight IS E'Masse du poisson capturé, en grammes';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.handling IS E'Manipulation post-capture';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.estimated_cohort IS E'Cohorte estimée (année de naissance)';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.validated_cohort IS E'Cohorte validée par expertise (année de naissance)';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.background IS E'Historique du poisson';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.remarks IS E'Commentaire général sur le poisson (état général, etc.)';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.identification_quality IS E'0 : identification incertaine\n1 : identification sûre';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.fish.fish_uuid IS E'UUID of the fish';
+-- ddl-end --
+ALTER TABLE sturwild.fish OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.location | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.location CASCADE;
+CREATE TABLE sturwild.location (
+ declaration_id integer NOT NULL,
+ country_id integer,
+ ices_id integer,
+ region_id integer,
+ environment_id integer,
+ environment_detail_id integer,
+ area_detail character varying,
+ longitude_gps character varying,
+ latitude_gps character varying,
+ longitude_declared_dd double precision,
+ latitude_declared_dd double precision,
+ longitude_estimated_dd double precision,
+ latitude_estimated_dd double precision,
+ longitude_dd double precision,
+ latitude_dd double precision,
+ geom geometry(POINT, 4326),
+ accuracy_id integer,
+ CONSTRAINT localisation_id PRIMARY KEY (declaration_id)
+);
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.area_detail IS E'Détail de la zone de pêche';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.longitude_gps IS E'Longitude au format degré, minute, seconde';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.latitude_gps IS E'Latitude au format degré, minute, seconde';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.longitude_declared_dd IS E'Longitude déclarée, au format décimal';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.latitude_declared_dd IS E'Latitude déclarée, au format décimal';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.longitude_estimated_dd IS E'Longitude estimée, au format décimal';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.latitude_estimated_dd IS E'Latitude estimée, au format décimal';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.longitude_dd IS E'Longitude utilisée, au format décimal';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.location.latitude_dd IS E'Latitude utilisée, au format décimal';
+-- ddl-end --
+ALTER TABLE sturwild.location OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.environment_environment_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.environment_environment_id_seq CASCADE;
+CREATE SEQUENCE sturwild.environment_environment_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.environment_environment_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.environment_detail_environment_detail_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.environment_detail_environment_detail_id_seq CASCADE;
+CREATE SEQUENCE sturwild.environment_detail_environment_detail_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.environment_detail_environment_detail_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.environment_detail | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.environment_detail CASCADE;
+CREATE TABLE sturwild.environment_detail (
+ environment_detail_id integer NOT NULL DEFAULT nextval('sturwild.environment_detail_environment_detail_id_seq'::regclass),
+ environment_detail_name character varying NOT NULL,
+ environment_detail_exchange varchar,
+ environment_detail_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT milieu_detail_pk PRIMARY KEY (environment_detail_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.environment_detail IS E'Milieu détaillé';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.environment_detail.environment_detail_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.environment_detail OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.environment | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.environment CASCADE;
+CREATE TABLE sturwild.environment (
+ environment_id integer NOT NULL DEFAULT nextval('sturwild.environment_environment_id_seq'::regclass),
+ environment_name character varying NOT NULL,
+ environment_exchange varchar,
+ environment_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT milieu_id PRIMARY KEY (environment_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.environment IS E'Table des milieux';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.environment.environment_id IS E'Identifiant du milieu';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.environment.environment_name IS E'Nom du milieu';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.environment.environment_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.environment OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.mime_type_mime_type_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.mime_type_mime_type_id_seq CASCADE;
+CREATE SEQUENCE sturwild.mime_type_mime_type_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.mime_type_mime_type_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.mime_type | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.mime_type CASCADE;
+CREATE TABLE sturwild.mime_type (
+ mime_type_id integer NOT NULL DEFAULT nextval('sturwild.mime_type_mime_type_id_seq'::regclass),
+ content_type character varying NOT NULL,
+ extension character varying NOT NULL,
+ CONSTRAINT mime_type_pk PRIMARY KEY (mime_type_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.mime_type IS E'Table des types mime, pour les documents associés';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.mime_type.content_type IS E'type mime officiel';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.mime_type.extension IS E'Extension du fichier correspondant';
+-- ddl-end --
+ALTER TABLE sturwild.mime_type OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.country_country_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.country_country_id_seq CASCADE;
+CREATE SEQUENCE sturwild.country_country_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.country_country_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.country | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.country CASCADE;
+CREATE TABLE sturwild.country (
+ country_id integer NOT NULL DEFAULT nextval('sturwild.country_country_id_seq'::regclass),
+ country_name character varying NOT NULL,
+ country_exchange varchar,
+ country_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT pays_id PRIMARY KEY (country_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.country IS E'Pays de pêche';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.country.country_id IS E'Identifiant du pays';
+-- ddl-end --
+ALTER TABLE sturwild.country OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.accuracy_accuracy_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.accuracy_accuracy_id_seq CASCADE;
+CREATE SEQUENCE sturwild.accuracy_accuracy_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 2147483647
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.accuracy_accuracy_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.accuracy | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.accuracy CASCADE;
+CREATE TABLE sturwild.accuracy (
+ accuracy_id integer NOT NULL DEFAULT nextval('sturwild.accuracy_accuracy_id_seq'::regclass),
+ accuracy_name character varying NOT NULL,
+ accuracy_exchange varchar,
+ accuracy_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT precision_pk PRIMARY KEY (accuracy_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.accuracy IS E'Précision de la localisation du point GPS';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.accuracy.accuracy_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.accuracy OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.tag_presence_tag_presence_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.tag_presence_tag_presence_id_seq CASCADE;
+CREATE SEQUENCE sturwild.tag_presence_tag_presence_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.tag_presence_tag_presence_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.tag_presence | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.tag_presence CASCADE;
+CREATE TABLE sturwild.tag_presence (
+ tag_presence_id integer NOT NULL DEFAULT nextval('sturwild.tag_presence_tag_presence_id_seq'::regclass),
+ tag_presence_name character varying NOT NULL,
+ tag_presence_exchange varchar,
+ tag_presence_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT tag_presence_pk PRIMARY KEY (tag_presence_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.tag_presence IS E'Table des types de présence de marque (présent, non signalé, absent)';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.tag_presence.tag_presence_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.tag_presence OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.request_request_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.request_request_id_seq CASCADE;
+CREATE SEQUENCE sturwild.request_request_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 2147483647
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.request_request_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.request | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.request CASCADE;
+CREATE TABLE sturwild.request (
+ request_id integer NOT NULL DEFAULT nextval('sturwild.request_request_id_seq'::regclass),
+ create_date timestamp NOT NULL,
+ last_exec timestamp,
+ title character varying NOT NULL,
+ body character varying NOT NULL,
+ login character varying NOT NULL,
+ datefields character varying,
+ CONSTRAINT request_pk PRIMARY KEY (request_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.request IS E'Request table in database';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.request.create_date IS E'Date of create of the request';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.request.last_exec IS E'Date of the last execution';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.request.title IS E'Title of the request';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.request.body IS E'Body of the request. Don''t begin it by SELECT, which will be added automatically';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.request.login IS E'Login of the creator of the request';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.request.datefields IS E'List of the date fields used in the request, separated by a comma, for format it';
+-- ddl-end --
+ALTER TABLE sturwild.request OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.status_status_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwild.status_status_id_seq CASCADE;
+CREATE SEQUENCE sturwild.status_status_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwild.status_status_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.status | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.status CASCADE;
+CREATE TABLE sturwild.status (
+ status_id integer NOT NULL DEFAULT nextval('sturwild.status_status_id_seq'::regclass),
+ status_name character varying NOT NULL,
+ status_exchange varchar,
+ status_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT statut_pk PRIMARY KEY (status_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.status IS E'Table des statuts de la déclaration';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.status.status_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.status OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.aclacl | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.aclacl CASCADE;
+CREATE TABLE sturwildgacl.aclacl (
+ aclaco_id integer NOT NULL,
+ aclgroup_id integer NOT NULL,
+ CONSTRAINT aclacl_pk PRIMARY KEY (aclaco_id,aclgroup_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.aclacl IS E'Table des droits attribués';
+-- ddl-end --
+ALTER TABLE sturwildgacl.aclacl OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.aclacl (aclaco_id, aclgroup_id) VALUES (E'1', E'1');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclacl (aclaco_id, aclgroup_id) VALUES (E'2', E'2');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclacl (aclaco_id, aclgroup_id) VALUES (E'3', E'3');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclacl (aclaco_id, aclgroup_id) VALUES (E'4', E'4');
+-- ddl-end --
+
+-- object: sturwildgacl.aclaco_aclaco_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.aclaco_aclaco_id_seq CASCADE;
+CREATE SEQUENCE sturwildgacl.aclaco_aclaco_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.aclaco_aclaco_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.aclaco | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.aclaco CASCADE;
+CREATE TABLE sturwildgacl.aclaco (
+ aclaco_id integer NOT NULL DEFAULT nextval('sturwildgacl.aclaco_aclaco_id_seq'::regclass),
+ aclappli_id integer NOT NULL,
+ aco character varying NOT NULL,
+ CONSTRAINT aclaco_pk PRIMARY KEY (aclaco_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.aclaco IS E'Table des droits gérés';
+-- ddl-end --
+ALTER TABLE sturwildgacl.aclaco OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.aclaco (aclappli_id, aco) VALUES (E'1', E'admin');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclaco (aclappli_id, aco) VALUES (E'1', E'consult');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclaco (aclappli_id, aco) VALUES (E'1', E'manage');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclaco (aclappli_id, aco) VALUES (E'1', E'param');
+-- ddl-end --
+
+-- object: sturwildgacl.aclappli_aclappli_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.aclappli_aclappli_id_seq CASCADE;
+CREATE SEQUENCE sturwildgacl.aclappli_aclappli_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.aclappli_aclappli_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.aclappli | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.aclappli CASCADE;
+CREATE TABLE sturwildgacl.aclappli (
+ aclappli_id integer NOT NULL DEFAULT nextval('sturwildgacl.aclappli_aclappli_id_seq'::regclass),
+ appli character varying NOT NULL,
+ applidetail character varying,
+ CONSTRAINT aclappli_pk PRIMARY KEY (aclappli_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.aclappli IS E'Table des applications gérées';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.aclappli.appli IS E'Nom de l''application pour la gestion des droits';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.aclappli.applidetail IS E'Description de l''application';
+-- ddl-end --
+ALTER TABLE sturwildgacl.aclappli OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.aclappli (aclappli_id, appli, applidetail) VALUES (E'1', E'sturwild', DEFAULT);
+-- ddl-end --
+
+-- object: sturwildgacl.aclgroup_aclgroup_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.aclgroup_aclgroup_id_seq CASCADE;
+CREATE SEQUENCE sturwildgacl.aclgroup_aclgroup_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.aclgroup_aclgroup_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.aclgroup | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.aclgroup CASCADE;
+CREATE TABLE sturwildgacl.aclgroup (
+ aclgroup_id integer NOT NULL DEFAULT nextval('sturwildgacl.aclgroup_aclgroup_id_seq'::regclass),
+ groupe character varying NOT NULL,
+ aclgroup_id_parent integer,
+ CONSTRAINT aclgroup_pk PRIMARY KEY (aclgroup_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.aclgroup IS E'Groupes des logins';
+-- ddl-end --
+ALTER TABLE sturwildgacl.aclgroup OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.aclgroup (groupe, aclgroup_id_parent) VALUES (E'admin', DEFAULT);
+-- ddl-end --
+INSERT INTO sturwildgacl.aclgroup (groupe, aclgroup_id_parent) VALUES (E'consult', DEFAULT);
+-- ddl-end --
+INSERT INTO sturwildgacl.aclgroup (groupe, aclgroup_id_parent) VALUES (E'manage', E'2');
+-- ddl-end --
+INSERT INTO sturwildgacl.aclgroup (groupe, aclgroup_id_parent) VALUES (E'param', E'3');
+-- ddl-end --
+
+-- object: sturwildgacl.acllogin_acllogin_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.acllogin_acllogin_id_seq CASCADE;
+CREATE SEQUENCE sturwildgacl.acllogin_acllogin_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.acllogin_acllogin_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.acllogin | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.acllogin CASCADE;
+CREATE TABLE sturwildgacl.acllogin (
+ acllogin_id integer NOT NULL DEFAULT nextval('sturwildgacl.acllogin_acllogin_id_seq'::regclass),
+ login character varying NOT NULL,
+ logindetail character varying NOT NULL,
+ totp_key character varying,
+ email varchar,
+ CONSTRAINT acllogin_pk PRIMARY KEY (acllogin_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.acllogin IS E'Table des logins des utilisateurs autorisés';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.acllogin.logindetail IS E'Nom affiché';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.acllogin.totp_key IS E'TOTP secret key for the user';
+-- ddl-end --
+ALTER TABLE sturwildgacl.acllogin OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.acllogin (login, logindetail, totp_key) VALUES (E'admin', E'admin', DEFAULT);
+-- ddl-end --
+
+-- object: sturwildgacl.acllogingroup | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.acllogingroup CASCADE;
+CREATE TABLE sturwildgacl.acllogingroup (
+ acllogin_id integer NOT NULL,
+ aclgroup_id integer NOT NULL,
+ CONSTRAINT acllogingroup_pk PRIMARY KEY (acllogin_id,aclgroup_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.acllogingroup IS E'Table des relations entre les logins et les groupes';
+-- ddl-end --
+ALTER TABLE sturwildgacl.acllogingroup OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.acllogingroup (acllogin_id, aclgroup_id) VALUES (E'1', E'1');
+-- ddl-end --
+INSERT INTO sturwildgacl.acllogingroup (acllogin_id, aclgroup_id) VALUES (E'1', E'4');
+-- ddl-end --
+
+-- object: sturwildgacl.log_log_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.log_log_id_seq CASCADE;
+CREATE SEQUENCE sturwildgacl.log_log_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.log_log_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.log | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.log CASCADE;
+CREATE TABLE sturwildgacl.log (
+ log_id integer NOT NULL DEFAULT nextval('sturwildgacl.log_log_id_seq'::regclass),
+ login character varying(32) NOT NULL,
+ nom_module character varying,
+ log_date timestamp NOT NULL,
+ commentaire character varying,
+ ipaddress character varying,
+ CONSTRAINT log_pk PRIMARY KEY (log_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.log IS E'Liste des connexions ou des actions enregistrées';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.log.log_date IS E'Heure de connexion';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.log.commentaire IS E'Donnees complementaires enregistrees';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.log.ipaddress IS E'Adresse IP du client';
+-- ddl-end --
+ALTER TABLE sturwildgacl.log OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.seq_logingestion_id | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.seq_logingestion_id CASCADE;
+CREATE SEQUENCE sturwildgacl.seq_logingestion_id
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 999999
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.seq_logingestion_id OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.logingestion | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.logingestion CASCADE;
+CREATE TABLE sturwildgacl.logingestion (
+ id integer NOT NULL DEFAULT nextval('sturwildgacl.seq_logingestion_id'::regclass),
+ login character varying(32) NOT NULL,
+ password character varying(255),
+ nom character varying(32),
+ prenom character varying(32),
+ mail character varying(255),
+ datemodif timestamp,
+ actif smallint DEFAULT 1,
+ is_expired boolean DEFAULT false,
+ is_clientws boolean DEFAULT false,
+ tokenws character varying,
+ nbattempts smallint DEFAULT 0,
+ lastattempt timestamp,
+ CONSTRAINT pk_logingestion PRIMARY KEY (id)
+);
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.logingestion.nbattempts IS E'Number of connection attempts';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.logingestion.lastattempt IS E'last attempt of connection';
+-- ddl-end --
+ALTER TABLE sturwildgacl.logingestion OWNER TO sturwild;
+-- ddl-end --
+
+INSERT INTO sturwildgacl.logingestion (login, password, nom, prenom, mail, datemodif, actif, is_expired, is_clientws, tokenws, nbattempts, lastattempt) VALUES (E'admin', E'cd916028a2d8a1b901e831246dd5b9b4d3832786ddc63bbf5af4b50d9fc98f50', E'admin', DEFAULT, DEFAULT, DEFAULT, E'1', DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT);
+-- ddl-end --
+
+-- object: sturwildgacl.passwordlost_passwordlost_id_seq | type: SEQUENCE --
+-- DROP SEQUENCE IF EXISTS sturwildgacl.passwordlost_passwordlost_id_seq CASCADE;
+CREATE SEQUENCE sturwildgacl.passwordlost_passwordlost_id_seq
+ INCREMENT BY 1
+ MINVALUE 1
+ MAXVALUE 9223372036854775807
+ START WITH 1
+ CACHE 1
+ NO CYCLE
+ OWNED BY NONE;
+
+-- ddl-end --
+ALTER SEQUENCE sturwildgacl.passwordlost_passwordlost_id_seq OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwildgacl.passwordlost | type: TABLE --
+-- DROP TABLE IF EXISTS sturwildgacl.passwordlost CASCADE;
+CREATE TABLE sturwildgacl.passwordlost (
+ passwordlost_id integer NOT NULL DEFAULT nextval('sturwildgacl.passwordlost_passwordlost_id_seq'::regclass),
+ id integer NOT NULL,
+ token character varying NOT NULL,
+ expiration timestamp NOT NULL,
+ usedate timestamp,
+ CONSTRAINT passwordlost_pk PRIMARY KEY (passwordlost_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwildgacl.passwordlost IS E'Table de suivi des pertes de mots de passe';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.passwordlost.token IS E'Jeton utilise pour le renouvellement';
+-- ddl-end --
+COMMENT ON COLUMN sturwildgacl.passwordlost.expiration IS E'Date d''expiration du jeton';
+-- ddl-end --
+ALTER TABLE sturwildgacl.passwordlost OWNER TO sturwild;
+-- ddl-end --
+
+-- object: log_commentaire_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwildgacl.log_commentaire_idx CASCADE;
+CREATE INDEX log_commentaire_idx ON sturwildgacl.log
+USING btree
+(
+ commentaire
+)
+WITH (FILLFACTOR = 90);
+-- ddl-end --
+
+-- object: log_date_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwildgacl.log_date_idx CASCADE;
+CREATE INDEX log_date_idx ON sturwildgacl.log
+USING btree
+(
+ log_date
+)
+WITH (FILLFACTOR = 90);
+-- ddl-end --
+
+-- object: log_ip_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwildgacl.log_ip_idx CASCADE;
+CREATE INDEX log_ip_idx ON sturwildgacl.log
+USING btree
+(
+ ipaddress
+)
+WITH (FILLFACTOR = 90);
+-- ddl-end --
+
+-- object: log_login_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwildgacl.log_login_idx CASCADE;
+CREATE INDEX log_login_idx ON sturwildgacl.log
+USING btree
+(
+ login
+)
+WITH (FILLFACTOR = 90);
+-- ddl-end --
+
+-- object: logingestion_login_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwildgacl.logingestion_login_idx CASCADE;
+CREATE UNIQUE INDEX logingestion_login_idx ON sturwildgacl.logingestion
+USING btree
+(
+ login
+)
+WITH (FILLFACTOR = 90);
+-- ddl-end --
+
+-- object: sturwild.handling | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.handling CASCADE;
+CREATE TABLE sturwild.handling (
+ handling_id serial NOT NULL,
+ handling_name varchar NOT NULL,
+ handling_exchange varchar,
+ handling_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT handling_pk PRIMARY KEY (handling_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.handling IS E'Types of handling used after catch';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.handling.handling_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.handling OWNER TO sturwild;
+-- ddl-end --
+
+-- object: sturwild.declaration_handling | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.declaration_handling CASCADE;
+CREATE TABLE sturwild.declaration_handling (
+ declaration_id integer NOT NULL,
+ handling_id integer NOT NULL,
+ CONSTRAINT declaration_handling_pk PRIMARY KEY (declaration_id,handling_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.declaration_handling IS E'List of all handling for a declaration';
+-- ddl-end --
+ALTER TABLE sturwild.declaration_handling OWNER TO sturwild;
+-- ddl-end --
+
+-- object: declaration_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration_handling DROP CONSTRAINT IF EXISTS declaration_fk CASCADE;
+ALTER TABLE sturwild.declaration_handling ADD CONSTRAINT declaration_fk FOREIGN KEY (declaration_id)
+REFERENCES sturwild.declaration (declaration_id) MATCH FULL
+ON DELETE CASCADE ON UPDATE CASCADE;
+-- ddl-end --
+
+-- object: handling_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration_handling DROP CONSTRAINT IF EXISTS handling_fk CASCADE;
+ALTER TABLE sturwild.declaration_handling ADD CONSTRAINT handling_fk FOREIGN KEY (handling_id)
+REFERENCES sturwild.handling (handling_id) MATCH FULL
+ON DELETE CASCADE ON UPDATE CASCADE;
+-- ddl-end --
+
+-- object: sturwild.target_species | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.target_species CASCADE;
+CREATE TABLE sturwild.target_species (
+ target_species_id serial NOT NULL,
+ target_species_name varchar NOT NULL,
+ target_species_exchange varchar,
+ target_species_order smallint NOT NULL DEFAULT 1,
+ CONSTRAINT target_species_pk PRIMARY KEY (target_species_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.target_species IS E'List of species targeted';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.target_species.target_species_exchange IS E'Name in english to exchange data between instances of Sturwild';
+-- ddl-end --
+ALTER TABLE sturwild.target_species OWNER TO sturwild;
+-- ddl-end --
+
+-- object: target_species_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS target_species_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT target_species_fk FOREIGN KEY (target_species_id)
+REFERENCES sturwild.target_species (target_species_id) MATCH FULL
+ON DELETE SET NULL ON UPDATE CASCADE;
+-- ddl-end --
+
+-- object: sturwild.fish_handling | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.fish_handling CASCADE;
+CREATE TABLE sturwild.fish_handling (
+ fish_id integer NOT NULL,
+ handling_id integer NOT NULL,
+ CONSTRAINT fish_handling_pk PRIMARY KEY (fish_id,handling_id)
+);
+-- ddl-end --
+ALTER TABLE sturwild.fish_handling OWNER TO sturwild;
+-- ddl-end --
+
+-- object: fish_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish_handling DROP CONSTRAINT IF EXISTS fish_fk CASCADE;
+ALTER TABLE sturwild.fish_handling ADD CONSTRAINT fish_fk FOREIGN KEY (fish_id)
+REFERENCES sturwild.fish (fish_id) MATCH FULL
+ON DELETE CASCADE ON UPDATE CASCADE;
+-- ddl-end --
+
+-- object: handling_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish_handling DROP CONSTRAINT IF EXISTS handling_fk CASCADE;
+ALTER TABLE sturwild.fish_handling ADD CONSTRAINT handling_fk FOREIGN KEY (handling_id)
+REFERENCES sturwild.handling (handling_id) MATCH FULL
+ON DELETE CASCADE ON UPDATE CASCADE;
+-- ddl-end --
+
+-- object: declaration_uid_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwild.declaration_uid_idx CASCADE;
+CREATE INDEX declaration_uid_idx ON sturwild.declaration
+USING btree
+(
+ declaration_uuid
+);
+-- ddl-end --
+
+-- object: fish_uuid_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwild.fish_uuid_idx CASCADE;
+CREATE INDEX fish_uuid_idx ON sturwild.fish
+USING btree
+(
+ fish_uuid
+);
+-- ddl-end --
+
+-- object: document_uuid_idx | type: INDEX --
+-- DROP INDEX IF EXISTS sturwild.document_uuid_idx CASCADE;
+CREATE INDEX document_uuid_idx ON sturwild.document
+USING btree
+(
+ document_uuid
+);
+-- ddl-end --
+
+-- object: sturwild.institute | type: TABLE --
+-- DROP TABLE IF EXISTS sturwild.institute CASCADE;
+CREATE TABLE sturwild.institute (
+ institute_id serial NOT NULL,
+ institute_code varchar NOT NULL,
+ institute_description varchar,
+ CONSTRAINT institute_pk PRIMARY KEY (institute_id)
+);
+-- ddl-end --
+COMMENT ON TABLE sturwild.institute IS E'List of institute partners';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.institute.institute_code IS E'Code of the institute';
+-- ddl-end --
+COMMENT ON COLUMN sturwild.institute.institute_description IS E'Description of the institute';
+-- ddl-end --
+ALTER TABLE sturwild.institute OWNER TO sturwild;
+-- ddl-end --
+
+-- object: institute_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS institute_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT institute_fk FOREIGN KEY (institute_id)
+REFERENCES sturwild.institute (institute_id) MATCH FULL
+ON DELETE SET NULL ON UPDATE CASCADE;
+-- ddl-end --
+
+-- object: capture_etat_declaration_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS capture_etat_declaration_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT capture_etat_declaration_fk FOREIGN KEY (capture_state_id)
+REFERENCES sturwild.capture_state (capture_state_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: capture_mode_capture_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS capture_mode_capture_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT capture_mode_capture_fk FOREIGN KEY (capture_method_id)
+REFERENCES sturwild.capture_method (capture_method_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: capture_type_capture_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS capture_type_capture_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT capture_type_capture_fk FOREIGN KEY (origin_id)
+REFERENCES sturwild.origin (origin_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: devenir_declaration_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS devenir_declaration_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT devenir_declaration_fk FOREIGN KEY (fate_id)
+REFERENCES sturwild.fate (fate_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: engin_type_declaration_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS engin_type_declaration_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT engin_type_declaration_fk FOREIGN KEY (gear_type_id)
+REFERENCES sturwild.gear_type (gear_type_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: espece_declaration_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS espece_declaration_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT espece_declaration_fk FOREIGN KEY (species_id)
+REFERENCES sturwild.species (species_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: statut_declaration_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.declaration DROP CONSTRAINT IF EXISTS statut_declaration_fk CASCADE;
+ALTER TABLE sturwild.declaration ADD CONSTRAINT statut_declaration_fk FOREIGN KEY (status_id)
+REFERENCES sturwild.status (status_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: individu_document_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.document DROP CONSTRAINT IF EXISTS individu_document_fk CASCADE;
+ALTER TABLE sturwild.document ADD CONSTRAINT individu_document_fk FOREIGN KEY (fish_id)
+REFERENCES sturwild.fish (fish_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: mime_type_document_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.document DROP CONSTRAINT IF EXISTS mime_type_document_fk CASCADE;
+ALTER TABLE sturwild.document ADD CONSTRAINT mime_type_document_fk FOREIGN KEY (mime_type_id)
+REFERENCES sturwild.mime_type (mime_type_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: evenement_capture_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.event DROP CONSTRAINT IF EXISTS evenement_capture_fk CASCADE;
+ALTER TABLE sturwild.event ADD CONSTRAINT evenement_capture_fk FOREIGN KEY (declaration_id)
+REFERENCES sturwild.declaration (declaration_id) MATCH SIMPLE
+ON DELETE CASCADE ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: evenement_type_evenement_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.event DROP CONSTRAINT IF EXISTS evenement_type_evenement_fk CASCADE;
+ALTER TABLE sturwild.event ADD CONSTRAINT evenement_type_evenement_fk FOREIGN KEY (event_type_id)
+REFERENCES sturwild.event_type (event_type_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: capture_etat_individu_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish DROP CONSTRAINT IF EXISTS capture_etat_individu_fk CASCADE;
+ALTER TABLE sturwild.fish ADD CONSTRAINT capture_etat_individu_fk FOREIGN KEY (capture_state_id)
+REFERENCES sturwild.capture_state (capture_state_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: capture_individu_fk1 | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish DROP CONSTRAINT IF EXISTS capture_individu_fk1 CASCADE;
+ALTER TABLE sturwild.fish ADD CONSTRAINT capture_individu_fk1 FOREIGN KEY (declaration_id)
+REFERENCES sturwild.declaration (declaration_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: devenir_individu_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish DROP CONSTRAINT IF EXISTS devenir_individu_fk CASCADE;
+ALTER TABLE sturwild.fish ADD CONSTRAINT devenir_individu_fk FOREIGN KEY (fate_id)
+REFERENCES sturwild.fate (fate_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: espece_individu_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish DROP CONSTRAINT IF EXISTS espece_individu_fk CASCADE;
+ALTER TABLE sturwild.fish ADD CONSTRAINT espece_individu_fk FOREIGN KEY (species_id)
+REFERENCES sturwild.species (species_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: presence_marque_individu_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.fish DROP CONSTRAINT IF EXISTS presence_marque_individu_fk CASCADE;
+ALTER TABLE sturwild.fish ADD CONSTRAINT presence_marque_individu_fk FOREIGN KEY (tag_presence_id)
+REFERENCES sturwild.tag_presence (tag_presence_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: ciem_localisation_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.location DROP CONSTRAINT IF EXISTS ciem_localisation_fk CASCADE;
+ALTER TABLE sturwild.location ADD CONSTRAINT ciem_localisation_fk FOREIGN KEY (ices_id)
+REFERENCES sturwild.ices (ices_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: declaration_localisation_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.location DROP CONSTRAINT IF EXISTS declaration_localisation_fk CASCADE;
+ALTER TABLE sturwild.location ADD CONSTRAINT declaration_localisation_fk FOREIGN KEY (declaration_id)
+REFERENCES sturwild.declaration (declaration_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: milieu_detail_localisation_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.location DROP CONSTRAINT IF EXISTS milieu_detail_localisation_fk CASCADE;
+ALTER TABLE sturwild.location ADD CONSTRAINT milieu_detail_localisation_fk FOREIGN KEY (environment_detail_id)
+REFERENCES sturwild.environment_detail (environment_detail_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: milieu_localisation_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.location DROP CONSTRAINT IF EXISTS milieu_localisation_fk CASCADE;
+ALTER TABLE sturwild.location ADD CONSTRAINT milieu_localisation_fk FOREIGN KEY (environment_id)
+REFERENCES sturwild.environment (environment_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: pays_localisation_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.location DROP CONSTRAINT IF EXISTS pays_localisation_fk CASCADE;
+ALTER TABLE sturwild.location ADD CONSTRAINT pays_localisation_fk FOREIGN KEY (country_id)
+REFERENCES sturwild.country (country_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: precision_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwild.location DROP CONSTRAINT IF EXISTS precision_fk CASCADE;
+ALTER TABLE sturwild.location ADD CONSTRAINT precision_fk FOREIGN KEY (accuracy_id)
+REFERENCES sturwild.accuracy (accuracy_id) MATCH FULL
+ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY IMMEDIATE;
+-- ddl-end --
+
+-- object: aclaco_aclacl_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.aclacl DROP CONSTRAINT IF EXISTS aclaco_aclacl_fk CASCADE;
+ALTER TABLE sturwildgacl.aclacl ADD CONSTRAINT aclaco_aclacl_fk FOREIGN KEY (aclaco_id)
+REFERENCES sturwildgacl.aclaco (aclaco_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: aclgroup_aclacl_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.aclacl DROP CONSTRAINT IF EXISTS aclgroup_aclacl_fk CASCADE;
+ALTER TABLE sturwildgacl.aclacl ADD CONSTRAINT aclgroup_aclacl_fk FOREIGN KEY (aclgroup_id)
+REFERENCES sturwildgacl.aclgroup (aclgroup_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: aclappli_aclaco_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.aclaco DROP CONSTRAINT IF EXISTS aclappli_aclaco_fk CASCADE;
+ALTER TABLE sturwildgacl.aclaco ADD CONSTRAINT aclappli_aclaco_fk FOREIGN KEY (aclappli_id)
+REFERENCES sturwildgacl.aclappli (aclappli_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: aclgroup_aclgroup_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.aclgroup DROP CONSTRAINT IF EXISTS aclgroup_aclgroup_fk CASCADE;
+ALTER TABLE sturwildgacl.aclgroup ADD CONSTRAINT aclgroup_aclgroup_fk FOREIGN KEY (aclgroup_id_parent)
+REFERENCES sturwildgacl.aclgroup (aclgroup_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: aclgroup_acllogingroup_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.acllogingroup DROP CONSTRAINT IF EXISTS aclgroup_acllogingroup_fk CASCADE;
+ALTER TABLE sturwildgacl.acllogingroup ADD CONSTRAINT aclgroup_acllogingroup_fk FOREIGN KEY (aclgroup_id)
+REFERENCES sturwildgacl.aclgroup (aclgroup_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: acllogin_acllogingroup_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.acllogingroup DROP CONSTRAINT IF EXISTS acllogin_acllogingroup_fk CASCADE;
+ALTER TABLE sturwildgacl.acllogingroup ADD CONSTRAINT acllogin_acllogingroup_fk FOREIGN KEY (acllogin_id)
+REFERENCES sturwildgacl.acllogin (acllogin_id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: logingestion_passwordlost_fk | type: CONSTRAINT --
+-- ALTER TABLE sturwildgacl.passwordlost DROP CONSTRAINT IF EXISTS logingestion_passwordlost_fk CASCADE;
+ALTER TABLE sturwildgacl.passwordlost ADD CONSTRAINT logingestion_passwordlost_fk FOREIGN KEY (id)
+REFERENCES sturwildgacl.logingestion (id) MATCH SIMPLE
+ON DELETE NO ACTION ON UPDATE NO ACTION;
+-- ddl-end --
+
+-- object: "grant_CU_26541e8cda" | type: PERMISSION --
+GRANT CREATE,USAGE
+ ON SCHEMA public
+ TO pg_database_owner;
+-- ddl-end --
diff --git a/install/pgsql/upgradedb-from-24.0.sh b/install/pgsql/upgradedb-from-24.0.sh
new file mode 100755
index 00000000..ed496478
--- /dev/null
+++ b/install/pgsql/upgradedb-from-24.0.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+ROOT=install/pgsql
+psql $ADDRESS -f "$ROOT/alter_24.0-24.1.sql"
\ No newline at end of file
diff --git a/install/translatedb/comment_sql.sql b/install/translatedb/comment_sql.sql
new file mode 100644
index 00000000..690f398f
--- /dev/null
+++ b/install/translatedb/comment_sql.sql
@@ -0,0 +1,72 @@
+comment on column sturwild.dbversion.dbversion_number is E'Number of the version';
+comment on column sturwild.dbversion.dbversion_date is E'Date of the version';
+comment on column sturwild.declaration.declaration_id is E'Identifier of the capture';
+comment on column sturwild.declaration.species_id is E'Species identifier';
+comment on column sturwild.declaration.capture_date is E'Date of the capture';
+comment on column sturwild.declaration.year is E'Fishing year';
+comment on column sturwild.declaration.estimated_capture_date is E'Estimation of capture date';
+comment on column sturwild.declaration.gear_mesh is E'Mesh size, if applicable';
+comment on column sturwild.declaration.target_species is E'Species normally targeted during fishing';
+comment on column sturwild.declaration.depth is E'Fishing depth, in meters';
+comment on column sturwild.declaration.depth_min is E'Minimum fishing depth, in meters';
+comment on column sturwild.declaration.depth_max is E'Maximum fishing depth, in meters';
+comment on column sturwild.declaration.length_min is E'Minimum length, in mm';
+comment on column sturwild.declaration.length_max is E'Maximum length, in mm';
+comment on column sturwild.declaration.weight_min is E'Minimum weight, in kg';
+comment on column sturwild.declaration.weight_max is E'Maximum weight, in kg';
+comment on column sturwild.declaration.fisher_code is E'fisher’s code';
+comment on column sturwild.declaration.contact is E'Other contact';
+comment on column sturwild.declaration.contact_coordinates is E'Coordonates of the other contact';
+comment on column sturwild.declaration.harbour_vessel is E'Home harbour of fishing vessel';
+comment on column sturwild.declaration.remarks is E'General remarks';
+comment on column sturwild.declaration.handling is E'Post-capture handling of the captured batch';
+comment on column sturwild.declaration.identification_quality is E'0: species identification uncertain
+1: identification certain';
+comment on column sturwild.document.document_name is E'Original name of the document';
+comment on column sturwild.document.document_description is E'Description of the document';
+comment on column sturwild.species.species_id is E'Identifier of the species';
+comment on column sturwild.species.species_name is E'Name of the spieces';
+comment on column sturwild.event.event_remarks is E'remarks on the event';
+comment on column sturwild.event.login is E'Login of the person who created the event';
+comment on column sturwild.fish.declaration_id is E'Identifier of the declaration';
+comment on column sturwild.fish.weight is E'weitgh of the fish caught, in grams';
+comment on column sturwild.fish.handling is E'Post-capture handling';
+comment on column sturwild.fish.fish_length is E'Length of the fish, in mm';
+comment on column sturwild.fish.estimated_cohort is E'Estimated cohort (year of birth)';
+comment on column sturwild.fish.validated_cohort is E'Validated cohort by expert opinion (year of birth)';
+comment on column sturwild.fish.background is E'Background of the fish';
+comment on column sturwild.fish.remarks is E'General remarks on the fish (general state, etc.)';
+comment on column sturwild.fish.identification_quality is E'0: species identification uncertain
+1: identification certain';
+comment on column sturwild.location.longitude_gps is E'Longitude in degree, minute, second';
+comment on column sturwild.location.latitude_gps is E'Latitude in degree, minute, second';
+comment on column sturwild.location.longitude_declared_dd is E'Declared longitude, in decimal format';
+comment on column sturwild.location.latitude_declared_dd is E'Declared latitude, in decimal format';
+comment on column sturwild.location.longitude_estimated_dd is E'Estimated longitude, in decimal format';
+comment on column sturwild.location.latitude_estimated_dd is E'Estimated latitude, in decimal format';
+comment on column sturwild.location.longitude_dd is E'Used longitude, in decimal format';
+comment on column sturwild.location.latitude_dd is E'used latitude, in decimal format';
+comment on column sturwild.environment.environment_id is E'Identifier of the environment';
+comment on column sturwild.environment.environment_name is E'Name of the environment';
+comment on column sturwild.mime_type.content_type is E'Official mime type';
+comment on column sturwild.mime_type.extension is E'File extension';
+comment on column sturwild.country.country_id is E'Identifier of the country';
+comment on column sturwild.country.country_order is E'Order of display in the application';
+comment on column sturwild.request.body is E'Body of the request';
+comment on table sturwild.capture_state is E'Table of capture status';
+comment on table sturwild.capture_method is E'Method of capturing fish';
+comment on table sturwild.origin is E'Origin of the capture (commercial, recreational, scientific)';
+comment on table sturwild.ices is E'Table of ICES fishing zones';
+comment on table sturwild.dbversion is E'Table of database versions';
+comment on table sturwild.declaration is E'Information relating to the declaration';
+comment on table sturwild.fate is E'Fate of sturgeon caught';
+comment on table sturwild.document is E'Numeric documents relating to a fish or an event';
+comment on table sturwild.gear_type is E'Table of gears';
+comment on table sturwild.event_type is E'Types of possible events on a declaration';
+comment on table sturwild.environment is E'Table of environment';
+comment on table sturwild.environment_detail is E'Environment detail';
+comment on table sturwild.mime_type is E'Table of mime types for associated documents';
+comment on table sturwild.country is E'Fishing country';
+comment on table sturwild.accuracy is E'Accuracy of GPS point location';
+comment on table sturwild.tag_presence is E'Table of tag presence types (present, not indicated, absent)';
+comment on table sturwild.status is E'Declaration status table';
diff --git a/install/translatedb/param_en.sql b/install/translatedb/param_en.sql
new file mode 100644
index 00000000..dc238704
--- /dev/null
+++ b/install/translatedb/param_en.sql
@@ -0,0 +1,201 @@
+insert into sturwild.target_species (target_species_name,target_species_exchange,target_species_order)
+ values
+('Shads','Alosa sp',1),
+('Eel','Anguilla anguilla',1),
+('Meager','Argyrosomus regius',1),
+('Brown crab','Cancer pagurus',1),
+('Mullets','Chelon spp, Liza spp',1),
+('Conger','Conger conger',1),
+('Brown Shrimp','Crangon crangon',1),
+('Wedge sole','Dicologlossa cuneata',1),
+('Lobster','Homarus gammarus',1),
+('Squid','Loligo spp',1),
+('Angler','Lophius piscatorius',1),
+('Spider crab','Maja squinado',1),
+('Whiting','Merlangus merlangius',1),
+('Hake','Merluccius merluccius',1),
+('Sea bass','Morone labrax + Dicentrarchus punctatus',1),
+('Red mullet','Mullus spp',1),
+('Sharks','Mustelus sp + Scyliorhinus sp',1),
+('Langoustine','Nephrops norvegicaus',1),
+('Spiny lobster','Palinurus elephas',1),
+('Marine lamprey','Petromyzon marinus',1),
+('Flounder','Platichthys flesus',1),
+('Plaice','Pleuronectes platessa',1),
+('Pollock','Pollachius spp',1),
+('Skates','Raja sp.',1),
+('Mackerel','Scomber scombrus',1),
+('Turbot','Scophthalmus maximus',1),
+('Cuttlefish','Sepia officinalis',1),
+('Sole','Solea solea',1),
+('Sea bream','Sparus sp + Spondyliosoma sp',1),
+('Bib','Trisopterus luscus',1);
+insert into sturwild.gear_type (gear_type_name,gear_type_exchange,gear_type_order)
+ values
+('Bottom otter trawl','Bottom otter trawl',1),
+('Beam trawl','Beam trawl',1),
+('Electric trawl','Electric trawl',1),
+('Pelagic trawl','Pelagic trawl',1),
+('Set gillnet','Set gillnet',1),
+('Drift gillnet','Drift gillnet',1),
+('Set trammel net','Set trammel net',1),
+('Drift trammel net','Drift trammel net',1),
+('Hooks and lines','Hooks and lines',1),
+('Fyke net','Fyke net',1),
+('Lift net','Lift net',1),
+('Purse seine','Purse seine',1);
+insert into sturwild.tag_presence (tag_presence_name,tag_presence_exchange,tag_presence_order)
+ values
+('no','no',1),
+('yes','yes',2),
+('not provided','not provided',3);
+insert into sturwild.handling (handling_name,handling_exchange,handling_order)
+ values
+('length','length',1),
+('weight','weight',2),
+('picture','picture',3),
+('video','video',4),
+('released','released',5),
+('samples','samples',6),
+('oxygenated in tank','oxygenated in tank',7),
+('observed, not caught','observed, not caught',8),
+('assessed size','assessed size',9),
+('landed','landed',10),
+('tag number noted','tag number noted',11),
+('transmitter picked up','transmitter picked up',12),
+('fish tank','fish tank',13),
+('auction','auction',14),
+('sold','sold',15),
+('frozen','frozen',16);
+insert into sturwild.fate (fate_name,fate_exchange,fate_order)
+ values
+('Dead','Dead',9),
+('dead and naturalized','dead and naturalized',10),
+('Ex situ stock','Ex situ stock',12),
+('Frozen','Frozen',11),
+('Landed','Landed',6),
+('Landed and released alive','Landed and released alive',7),
+('Landed dead','Landed dead',8),
+('released alive','released alive',1),
+('Released dead','Released dead',3),
+('Released weak','Released weak',2),
+('stranded and left behind','stranded and left behind',4),
+('Strandled dead','Strandled dead',5),
+('Unknown','Unknown',20);
+insert into sturwild.status (status_name,status_exchange,status_order)
+ values
+('In data entry','In data entry',1),
+('Awaiting further information','Awaiting further information',2),
+('Declaration validated','Declaration validated',3),
+('Declaration confirmed','Declaration confirmed',4);
+insert into sturwild.origin (origin_name,origin_exchange,origin_order)
+ values
+('Professional fishing','Professional fishing',1),
+('Recreational fishing','Recreational fishing',2),
+('Scientific professional fishing','Scientific professional fishing',3),
+('Other','Other',4),
+('Unknown','Unknown',5);
+insert into sturwild.environment (environment_name,environment_exchange,environment_order)
+ values
+('Atlantic','Atlantic',1),
+('Estuary','Estuary',2),
+('Fjord','Fjord',3),
+('River','River',4),
+('English Channel','English Channel',5),
+('North Sea','North Sea',6),
+('Estuary plume','Estuary plume',7),
+('Body of water','Body of water',9),
+('Lagoon','Lagoon',10);
+insert into sturwild.environment_detail (environment_detail_name,environment_detail_exchange,environment_detail_order)
+ values
+('Adour','Adour',1),
+('Brittany','Brittany',1),
+('Belgium','Belgium',1),
+('Charente','Charente',1),
+('Charente Maritime','Charente Maritime',1),
+('Denmark','Denmark',1),
+('Dordogne','Dordogne',1),
+('Spain','Spain',1),
+('Garonne','Garonne',1),
+('Gironde','Gironde',1),
+('Upper Normandy','Upper Normandy',1),
+('Lande','Lande',1),
+('Loire','Loire',1),
+('Meuse','Meuse',1),
+('Norway','Norway',1),
+('Netherlands','Netherlands',1),
+('Netherlands Rhine','Netherlands Rhine',1),
+('La Balme lake','La Balme lake',1),
+('Pointe Bretagne','Pointe Bretagne',1),
+('Seine','Seine',1),
+('Sèvre Niortaise','Sèvre Niortaise',1),
+('Thames','Thames',1),
+('Taw','Taw',1),
+('Trent','Trent',1),
+('Vendée','Vendée',1),
+('Vilaine','Vilaine',1),
+('Isle','Isle',1);
+insert into sturwild.accuracy (accuracy_name,accuracy_exchange,accuracy_order)
+ values
+('GPS point provided by the declarant','GPS point provided by the declarant',1),
+('Estimated GPS point < 1km','Estimated GPS point < 1km',2),
+('Estimated GPS point 1 - 10 km','Estimated GPS point 1 - 10 km',3),
+('Estimated GPS point > 10 km','Estimated GPS point > 10 km',4);
+insert into sturwild.event_type (event_type_name,event_type_exchange,event_type_order)
+ values
+('Entering the declaration','Entering the declaration',1),
+('Request for information','Request for information',2),
+('Declaration validation','Declaration validation',3),
+('Confirmation of declaration','Confirmation of declaration',4),
+('Sending thanks','Sending thanks',5);
+insert into sturwild.species (species_name,species_exchange,species_order)
+ values
+('Acipenser sturio','Acipenser sturio',1),
+('Acipenser baerii','Acipenser baerii',2),
+('Acipenser gueldenstaedtii','Acipenser gueldenstaedtii',2),
+('Huso huso','Huso huso',2),
+('Huso bester','Huso bester',2),
+('Acipenser oxyrinchus','Acipenser oxyrinchus',2),
+('unidentified','unidentified',9),
+('Acipenser sp','Acipenser sp',2),
+('Huso huso or bester','Huso huso or bester',2);
+insert into sturwild.capture_state (capture_state_name,capture_state_exchange,capture_state_order)
+ values
+('Very good condition','Very good condition',1),
+('Good condition','Good condition',2),
+('Average condition','Average condition',3),
+('Living','Living',4),
+('Thin','Thin',6),
+('Poor','Poor',7),
+('Injured','Injured',8),
+('Critical condition','Critical condition',9),
+('Dead','Dead',10),
+('Dead Stranded','Dead Stranded',11),
+('Unknown','Unknown',12);
+insert into sturwild.country (country_name,country_exchange,country_order)
+ values
+('France','France',1),
+('United Kingdom','United Kingdom',2),
+('Belgium','Belgium',3),
+('Denmark','Denmark',4),
+('Spain','Spain',5),
+('Norway','Norway',6),
+('Netherlands','Netherlands',7),
+('Germany','Germany',8),
+('Unknown','Unknown',99);
+insert into sturwild.capture_method (capture_method_name,capture_method_exchange,capture_method_order)
+ values
+('Net','Net',1),
+('Lift net','Lift net',1),
+('Trawl','Trawl',1),
+('Beached','Beached',1),
+('Trawl','Trawl',1),
+('Pushnet','Pushnet',1),
+('Line','Line',1),
+('Unknown','Unknown',1),
+('Trap','Trap',1),
+('Line','Line',1),
+('Filter','Filter',1),
+('Found','Found',1),
+('Fyke net','Fyke net',1),
+('Submarine hunting','Submarine hunting',1);
diff --git a/install/upgradedb-from-23.0.sh b/install/upgradedb-from-23.0.sh
new file mode 100755
index 00000000..a5f42870
--- /dev/null
+++ b/install/upgradedb-from-23.0.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+ROOT=install/pgsql
+psql $ADDRESS -f "$ROOT/alter_23.0-24.0.sql"
\ No newline at end of file
diff --git a/install/upgradedb-from-24.1.sh b/install/upgradedb-from-24.1.sh
new file mode 100755
index 00000000..2abafeaf
--- /dev/null
+++ b/install/upgradedb-from-24.1.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+echo "Your database is already in version 24.1"
\ No newline at end of file