diff --git a/scripts/install b/scripts/install index ab731c2..54c5cbb 100755 --- a/scripts/install +++ b/scripts/install @@ -22,7 +22,7 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Configuring a PostgreSQL database..." -ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name} WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" +# ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name} WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name}olap WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name}tenant WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" diff --git a/scripts/remove b/scripts/remove index 8aa75fa..9d66d98 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,6 +28,10 @@ ynh_remove_logrotate # Remove the log files ynh_secure_remove --file="/var/log/$app" +# Remove additional databases +ynh_psql_drop_db "${db_name}tenant" +ynh_psql_drop_db "${db_name}olap" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index c1fb10c..bb4d8e5 100755 --- a/scripts/restore +++ b/scripts/restore @@ -22,7 +22,13 @@ chown -R "$app:www-data" "$install_dir" #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql +# ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name} WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" +ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name}olap WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" +ynh_psql_execute_as_root --sql="CREATE DATABASE ${db_name}tenant WITH OWNER ${db_user} TEMPLATE template0 ENCODING 'UTF8';" + +ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="${db_name}" < ./db.sql +ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="${db_name}olap" < ./dbolap.sql +ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="${db_name}tenant" < ./dbtenant.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS