Browse Source

Fix upgrade from old version

testing
Josué Tille 3 weeks ago
parent
commit
7e884bdd1a
No known key found for this signature in database GPG Key ID: 716A6C99B04194EF
2 changed files with 6 additions and 2 deletions
  1. +1
    -1
      scripts/restore
  2. +5
    -1
      scripts/upgrade

+ 1
- 1
scripts/restore View File

@@ -23,7 +23,7 @@ ynh_script_progression --message="Loading settings..."
app=$YNH_APP_INSTANCE_NAME

domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
path_url=$(ynh_normalize_url_path --path_url $(ynh_app_setting_get --app $app --key path))
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
db_user=$db_name


+ 5
- 1
scripts/upgrade View File

@@ -18,7 +18,7 @@ ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME

domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
path_url=$(ynh_normalize_url_path --path_url $(ynh_app_setting_get --app $app --key path))
final_path=$(ynh_app_setting_get --app $app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
secret=$(ynh_app_setting_get --app $app --key=secret)
@@ -142,6 +142,10 @@ ln -s "/etc/uwsgi/apps-available/$app.ini" "$final_path/syncserver.ini"
# configure uwsgi
ynh_add_uwsgi_service 'domain secret db_user db_pwd db_name'

# Upgrade database table
ynh_mysql_execute_as_root --sql='ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `keys_changed_at` BIGINT NULL AFTER `replaced_at`;' --database=$db_name
ynh_mysql_execute_as_root --sql='ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `node` VARCHAR(255) NULL AFTER `keys_changed_at`;' --database=$db_name

#=================================================
# GENERIC FINALIZATION
#=================================================


Loading…
Cancel
Save