From 4bbb484d00a897c17eba72ac57cc7a9cf45bee87 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Thu, 11 Oct 2012 10:55:11 +0000 Subject: [PATCH] updating sql migration script to handle the escaped wildcard --- install/upgrades/1.1.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install/upgrades/1.1.php b/install/upgrades/1.1.php index 34f26f6b..c6005df5 100644 --- a/install/upgrades/1.1.php +++ b/install/upgrades/1.1.php @@ -31,7 +31,7 @@ $db->query("select distinct uid,login,pass from db;"); //on insere dans dbusers avec enabled = admin $query=array(); while($db->next_record()){ - $query[]="insert into dbusers values('',".$db->f('uid').",'".$db->f('login')."','".$db->f('pass')."',\"ADMIN\");"; + $query[]="insert or update into dbusers values('',".$db->f('uid').",'".$db->f('login')."','".$db->f('pass')."',\"ADMIN\");"; } foreach ($query as $q){ $db->query($q); @@ -43,6 +43,7 @@ $db->query("select Db from mysql.db ;"); $query2=array(); while($db->next_record()){ $dbn=preg_replace("/^([A-Za-z0-9]*)_([A-Za-z0-9]*)/","$1\_$2",$db->f('Db')); + print_r( " update mysql.db set Db=replace(Db,'".$db->f('Db')."','".$dbn."');"); $query2[]="update mysql.db set Db=replace(Db,'".$db->f('Db')."','".$dbn."');"; }