1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kresus_ynh.git synced 2024-09-03 19:36:10 +02:00

Merge pull request #58 from nicofrand/sql

Fix postgresql missing on upgrade when  creating DB
This commit is contained in:
Jean-Baptiste 2020-05-02 13:26:41 +02:00 committed by GitHub
commit 9eff3a6902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 7 deletions

View file

@ -15,7 +15,7 @@
"requirements": {
"yunohost": ">= 3.6.0"
},
"version": "0.16.0~ynh1",
"version": "0.16.0~ynh2",
"multi_instance": true,
"services": [
"nginx"

View file

@ -48,12 +48,6 @@ if [ -z "$salt" ]; then
ynh_app_setting_set "$app" salt "$salt"
fi
if [ -z "$db_pwd" ]; then
ynh_psql_test_if_first_run
ynh_psql_setup_db "$db_user" "$db_name"
db_pwd=$(ynh_app_setting_get "$app" psqlpwd)
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
@ -83,6 +77,14 @@ path_url=$(ynh_normalize_url_path "$path_url")
ynh_install_app_dependencies $pkg_dependencies
# Now that postgresql is installed, check the db exists and the user is set up
if [ -z "$db_pwd" ]; then
ynh_psql_test_if_first_run
ynh_psql_setup_db "$db_user" "$db_name"
db_pwd=$(ynh_app_setting_get "$app" psqlpwd)
fi
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================