Bladeren bron

Merge pull request #66 from yalh76/database_actions_order

Database actions order
Maniack Crudelis 5 jaren geleden
bovenliggende
commit
ebbb675580
2 gewijzigde bestanden met toevoegingen van 14 en 14 verwijderingen
  1. 6 6
      scripts/remove
  2. 8 8
      scripts/restore

+ 6 - 6
scripts/remove

@@ -42,18 +42,18 @@ fi
 ynh_remove_systemd_config
 
 #=================================================
-# REMOVE DEPENDENCIES
+# REMOVE THE MYSQL DATABASE
 #=================================================
 
-# Remove metapackage and its dependencies
-ynh_remove_app_dependencies
+# Remove a database if it exists, along with the associated user
+ynh_mysql_remove_db $db_user $db_name
 
 #=================================================
-# REMOVE THE MYSQL DATABASE
+# REMOVE DEPENDENCIES
 #=================================================
 
-# Remove a database if it exists, along with the associated user
-ynh_mysql_remove_db $db_user $db_name
+# Remove metapackage and its dependencies
+ynh_remove_app_dependencies
 
 #=================================================
 # REMOVE APP MAIN DIR

+ 8 - 8
scripts/restore

@@ -54,14 +54,6 @@ ynh_restore_file "/etc/nginx/conf.d/$domain.d/$app.conf"
 
 ynh_restore_file "$final_path"
 
-#=================================================
-# RESTORE THE MYSQL DATABASE
-#=================================================
-
-db_pwd=$(ynh_app_setting_get $app mysqlpwd)
-ynh_mysql_setup_db $db_name $db_name $db_pwd
-ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
-
 #=================================================
 # RECREATE THE DEDICATED USER
 #=================================================
@@ -91,6 +83,14 @@ ynh_restore_file "/etc/php5/fpm/pool.d/$app.conf"
 # Define and install dependencies
 ynh_install_app_dependencies deb1 deb2
 
+#=================================================
+# RESTORE THE MYSQL DATABASE
+#=================================================
+
+db_pwd=$(ynh_app_setting_get $app mysqlpwd)
+ynh_mysql_setup_db $db_name $db_name $db_pwd
+ynh_mysql_connect_as $db_name $db_pwd $db_name < ./db.sql
+
 #=================================================
 # RESTORE SYSTEMD
 #=================================================