diff --git a/check_process b/check_process index 50f1de2..25aab00 100644 --- a/check_process +++ b/check_process @@ -14,7 +14,8 @@ setup_private=1 setup_public=1 upgrade=1 - #upgrade=1 from_commit=CommitHash + # 5.3.12~ynh1 + upgrade=1 from_commit=b5305cfd99c5d0d356cf64e9d490e91d9b0cbae0 backup_restore=1 multi_instance=0 port_already_use=0 @@ -22,7 +23,3 @@ ;;; Options Email= Notification=none -;;; Upgrade options - ; commit=CommitHash - name=Name and date of the commit. - manifest_arg=domain=DOMAIN&path=PATH&is_public=1&language=fr&admin=USER&password=pass&port=666& diff --git a/manifest.json b/manifest.json index 36ee972..e567bda 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "Fab Lab management solution." }, - "version": "5.3.12~ynh1", + "version": "5.3.12~ynh2", "url": "https://www.fab-manager.com", "upstream": { "license": "AGPL-3.0-or-later", diff --git a/scripts/restore b/scripts/restore index 4ac1762..82b3a66 100755 --- a/scripts/restore +++ b/scripts/restore @@ -107,6 +107,11 @@ ynh_script_progression --message="Restoring the PostgreSQL database..." db_pwd=$(ynh_app_setting_get --app=$app --key=psqlpwd) ynh_psql_test_if_first_run ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd +ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name" +ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" --database=$db_name +ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" --database=$db_name +ynh_psql_execute_as_root --sql="CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;" --database=$db_name +ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name" ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 9ad1f4d..6c9c7c6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -146,7 +146,9 @@ then ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn cache clean + ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH SUPERUSER;" --database="$db_name" ynh_exec_warn_less ynh_exec_as $app env RAILS_ENV=production RACK_ENV=production $ynh_ruby_load_path bin/bundle exec rake db:migrate + ynh_psql_execute_as_root --sql="ALTER USER $db_user WITH NOSUPERUSER;" --database="$db_name" ynh_exec_warn_less ynh_exec_as $app env RAILS_ENV=production RACK_ENV=production $ynh_ruby_load_path bin/bundle exec rake assets:precompile popd fi