From 17cd4e4f16c9f4650bcddd761d189436bb537e76 Mon Sep 17 00:00:00 2001 From: Andreas Moik Date: Wed, 6 Apr 2016 15:57:05 +0200 Subject: [PATCH] bugfix --- system/dbupdate_eine_uid.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/system/dbupdate_eine_uid.php b/system/dbupdate_eine_uid.php index cb016218b..a880a9f88 100644 --- a/system/dbupdate_eine_uid.php +++ b/system/dbupdate_eine_uid.php @@ -34,11 +34,12 @@ echo ' $all_tables_to_update = array ( - array("schema" => "bis", "name" => "tbl_bisio", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), - array("schema" => "campus", "name" => "tbl_lvgesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), - array("schema" => "campus", "name" => "tbl_studentbeispiel", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" ), - array("schema" => "campus", "name" => "tbl_studentuebung", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" ), - array("schema" => "campus", "name" => "tbl_legesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), + array("schema" => "bis", "name" => "tbl_bisio", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), + array("schema" => "campus", "name" => "tbl_lvgesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), + array("schema" => "campus", "name" => "tbl_studentbeispiel", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" ), + array("schema" => "campus", "name" => "tbl_studentuebung", "from" => "student_uid", "to" => "uid", "datatype" => "varchar(32)", "newTarget" => "tbl_benutzer", "newTargetSchema" => "public", "pickDataFrom" => "tbl_benutzer", "pickDataFromCol" => "uid" ), + array("schema" => "campus", "name" => "tbl_legesamtnote", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), + array("schema" => "lehre", "name" => "tbl_abschlusspruefung", "from" => "student_uid", "to" => "prestudent_id", "datatype" => "int", "newTarget" => "tbl_prestudent", "newTargetSchema" => "public", "pickDataFrom" => "tbl_student", "pickDataFromCol" => "student_uid"), ); if(!isset($_POST["action"])) @@ -231,7 +232,7 @@ function modifyOneTable($db, $table) if(!$pk_drop_result = $db->db_query('ALTER TABLE '.$table["schema"].".".$table["name"].' DROP CONSTRAINT '.$row->indexname)) { - echo "

ACHTUNG: DROPPEN von PRIMARY KEY ".$row->indexname." fehlgeschlagen(wird übersprungen)

"; + echo "

ACHTUNG: DROPPEN von PRIMARY KEY ".$row->indexname." fehlgeschlagen

"; $db->db_query("ROLLBACK;"); return; } @@ -243,13 +244,13 @@ function modifyOneTable($db, $table) { if(!$index_drop_result = $db->db_query('DROP INDEX '.$table["schema"].".".$row->indexname)) { - echo "

ACHTUNG: DROPPEN von INDEX ".$row->indexname." fehlgeschlagen(wird übersprungen)

"; + echo "

ACHTUNG: DROPPEN von INDEX ".$row->indexname." fehlgeschlagen

"; $db->db_query("ROLLBACK;"); return; } $index_add_query = str_replace ($table["from"], $table["to"], $row->indexdef ); - $indices[] = 'ALTER TABLE '.$table["schema"].".".$table["name"].' ADD CONSTRAINT '.$row->indexname.' '.$index_add_query; + $indices[] = $index_add_query; } } @@ -291,7 +292,7 @@ function modifyOneTable($db, $table) { if(!$pk_add_result = $db->db_query($pk)) { - echo "

ACHTUNG: ADDEN von PRIMARY KEY ".$row->indexname." fehlgeschlagen(wird übersprungen)

"; + echo "

ACHTUNG: ADDEN von PRIMARY KEY ".$row->indexname." fehlgeschlagen

"; $db->db_query("ROLLBACK;"); return; } @@ -299,8 +300,8 @@ function modifyOneTable($db, $table) foreach( $indices as $ind) { if(!$index_add_result = $db->db_query($ind)) - { - echo "

ACHTUNG: ADDEN von INDEX ".$row->indexname." fehlgeschlagen(wird übersprungen)

"; + {echo $ind; + echo "

ACHTUNG: ADDEN von INDEX ".$row->indexname." fehlgeschlagen

"; $db->db_query("ROLLBACK;"); return; }