Clean orphan lob : when upgrade + restore
This commit is contained in:
parent
e5acc9e7d9
commit
30b2499b4d
3 changed files with 9 additions and 23 deletions
|
|
@ -181,18 +181,6 @@ if (isset($_POST["FMOD_NAME"]))
|
|||
$Res = $cn_mod->exec_sql("delete from action_tags");
|
||||
$Res = $cn_mod->exec_sql("delete from document");
|
||||
|
||||
// Remove lob file
|
||||
$Res = $cn_mod->exec_sql("select distinct d_lob from document");
|
||||
if (Database::num_row($Res) != 0)
|
||||
{
|
||||
$a_lob = Database::fetch_all($Res);
|
||||
$a_lob = ($a_lob == false) ? array():$a_lob;
|
||||
//var_dump($a_lob);
|
||||
foreach ($a_lob as $lob)
|
||||
{
|
||||
$cn_mod->lo_unlink($lob['d_lob']);
|
||||
}
|
||||
}
|
||||
// reset sequences for Follow-up
|
||||
$a_seq=$cn_mod->get_array(" select sequence_name "
|
||||
. " from information_schema.sequences "
|
||||
|
|
@ -225,14 +213,7 @@ if (isset($_POST["FMOD_NAME"]))
|
|||
$Res = $cn_mod->exec_sql("delete from document_modele");
|
||||
$Res = $cn_mod->exec_sql("delete from op_predef");
|
||||
|
||||
// Remove lob file
|
||||
$Res = $cn_mod->exec_sql("select distinct loid from pg_largeobject");
|
||||
if (Database::num_row($Res) != 0)
|
||||
{
|
||||
$a_lob = Database::fetch_all($Res);
|
||||
foreach ($a_lob as $lob)
|
||||
$cn_mod->lo_unlink($lob['loid']);
|
||||
}
|
||||
|
||||
}
|
||||
if (isset($_POST['CANAL']))
|
||||
{
|
||||
|
|
@ -252,6 +233,8 @@ if (isset($_POST["FMOD_NAME"]))
|
|||
$cn_mod->exec_sql(" drop schema ".$a_schema[$i]['nspname']." cascade");
|
||||
}
|
||||
}
|
||||
// Clean orphan log
|
||||
$cn_mod->orphan_lob_clean();
|
||||
|
||||
}
|
||||
// Show all available templates
|
||||
|
|
|
|||
|
|
@ -131,10 +131,11 @@ if ( isset ($_REQUEST['sa'] ))
|
|||
}
|
||||
$new_cn=new Database($id);
|
||||
|
||||
$new_cn->apply_patch($name,0);
|
||||
$new_cn->apply_patch($name);
|
||||
echo '<span class="error">'._('Ne pas recharger la page, sinon votre base de données sera restaurée une fois de plus').'</span>';
|
||||
Dossier::synchro_admin($id);
|
||||
User::remove_inexistant_user($id);
|
||||
$new_cn->clean_orphan_lob();
|
||||
echo $retour;
|
||||
|
||||
echo '</div>';
|
||||
|
|
@ -192,8 +193,8 @@ if ( isset ($_REQUEST['sa'] ))
|
|||
|
||||
$new_cn=new Database($id,'mod');
|
||||
|
||||
$new_cn->apply_patch($name,0);
|
||||
|
||||
$new_cn->apply_patch($name);
|
||||
$new_cn->clean_orphan_lob();
|
||||
echo '<span class="error">'._('Ne pas recharger la page, sinon votre base de données sera restaurée une fois de plus').'</span>';
|
||||
echo $retour;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ if ($sb === "upg_all" && (!defined('MULTI')||(defined('MULTI')&&MULTI==1)))
|
|||
$db->apply_patch($db_row['dos_name']);
|
||||
Dossier::synchro_admin($db_row['dos_id']);
|
||||
User::remove_inexistant_user($db_row['dos_id']);
|
||||
$db->clean_orphan_lob();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -96,6 +97,7 @@ if ($sb === "upg_all" && (!defined('MULTI')||(defined('MULTI')&&MULTI==1)))
|
|||
{
|
||||
$db=new Database($db_row['mod_id'], 'mod');
|
||||
$db->apply_patch($db_row['mod_name']);
|
||||
$db->clean_orphan_lob();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue