diff --git a/include/class/database.class.php b/include/class/database.class.php
index 216d3f400..101cc5e61 100644
--- a/include/class/database.class.php
+++ b/include/class/database.class.php
@@ -133,7 +133,6 @@ class Database extends DatabaseCore
echo '
';
for ($i = 4; $i <= $MaxVersion; $i++) {
$to = $i + 1;
-
if ($this->get_version() <= $i) {
if ($this->get_version() == 97) {
if ($this->exist_schema("amortissement")) {
@@ -145,7 +144,8 @@ class Database extends DatabaseCore
echo "- Patching " . $p_name .
" from the version " . $this->get_version() . " to $to ";
-
+ $this->execute_script(NOALYSS_INCLUDE . '/sql/patch/upgrade' . $i . '.sql');
+ echo $succeed;
if (!DEBUG)
ob_start();
diff --git a/include/lib/database_core.class.php b/include/lib/database_core.class.php
index 3deb582af..098b7d6ca 100644
--- a/include/lib/database_core.class.php
+++ b/include/lib/database_core.class.php
@@ -284,6 +284,7 @@ class DatabaseCore
if ($hf == false) {
throw new Exception ('Ne peut ouvrir ' . $script);
}
+ printf (" open %s
", $script);
$sql = "";
$flag_function = false;
while (!feof($hf)) {
diff --git a/include/sql/patch/upgrade142.sql b/include/sql/patch/upgrade142.sql
index 3afaed6c0..35dc934ca 100644
--- a/include/sql/patch/upgrade142.sql
+++ b/include/sql/patch/upgrade142.sql
@@ -2,7 +2,7 @@ begin;
CREATE OR REPLACE FUNCTION comptaproc.find_pcm_type(pp_value account_type)
RETURNS text
-AS $function$
+AS $BODY$
declare
str_type parm_poste.p_type%TYPE;
str_value parm_poste.p_type%TYPE;
@@ -37,7 +37,8 @@ begin
-- si ni parent ou parm_poste alors return CON
return 'CON';
end;
-$function$
- LANGUAGE plpgsql;
+$BODY$
+LANGUAGE plpgsql;
+
insert into version (val,v_description) values (143,'Corrige function find_pcm_type');
commit ;