mirror of
https://github.com/YunoHost-Apps/mattermost_ynh.git
synced 2024-09-03 19:36:29 +02:00
delete the psql db if the migration fails
This commit is contained in:
parent
386cdb633d
commit
b4fcf41f41
1 changed files with 5 additions and 0 deletions
|
@ -56,6 +56,10 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
|
|||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# Remove the PostgreSQL db in case of error during the migration.
|
||||
if [ -n "$remove_psql_in_case_of_error" ]; then
|
||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
fi
|
||||
# Restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
|
@ -118,6 +122,7 @@ ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies
|
|||
if mysqlshow | grep -q "^| $db_name "; then
|
||||
# Mattermost only support MySQL and PostgreSQL (not MariaDB...)
|
||||
# Migrate the database from MariaDB to PostgreSQL
|
||||
remove_psql_in_case_of_error=1
|
||||
mariadb-to-pg
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue