-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
We have lost a database while updating a plugin mfbase.
Problem
In mfext, updating a plugin trigger the uninstall of the plugin:
def u_plugin(typ, name, fil):
echo_running("- Updating %s plugin: %s..." % (typ, name))
try:
plugins_manager.uninstall_plugin(name)
It causes mfbase to call the preunintall script (https://github.com/metwork-framework/mfbase/blob/master/adm/_plugins.preuninstall) with the dropdb/dropuser commands:
dropdb --if-exists -h "${MFMODULE_RUNTIME_HOME}/var" -p "${MFBASE_POSTGRESQL_PORT}" -U "${MFBASE_POSTGRESQL_USERNAME}" "plugin_${NAME}" || RES=1
dropuser --if-exists -h "${MFMODULE_RUNTIME_HOME}/var" -p "${MFBASE_POSTGRESQL_PORT}" -U "${MFBASE_POSTGRESQL_USERNAME}" "plugin_${NAME}" || RES=1
Proposed solution
During the plugin "update", if the database/user already exists, do not drop them!
But it seems in metwork the update always uninstalls then installs...
Metadata
Metadata
Assignees
Labels
No labels