|
@@ -59,10 +59,11 @@ jQuery(document).ready(function () {
|
|
|
|
|
|
|
|
public function runAction() {
|
|
public function runAction() {
|
|
|
$sql = "call `update_project_path_idx_rec`();";
|
|
$sql = "call `update_project_path_idx_rec`();";
|
|
|
- // TODO: update fields:
|
|
|
|
|
- // `IN7_MK_BAZA_DYSTRYBUCJI`.`path`
|
|
|
|
|
- // `IN7_DZIENNIK_KORESP`.`path`
|
|
|
|
|
- // `PROBLEMS`.`ID_PROJECT_path`
|
|
|
|
|
|
|
+ /* update fields:
|
|
|
|
|
+ * `IN7_MK_BAZA_DYSTRYBUCJI`.`path`
|
|
|
|
|
+ * `IN7_DZIENNIK_KORESP`.`path`
|
|
|
|
|
+ * `PROBLEMS`.`ID_PROJECT_path`
|
|
|
|
|
+ */
|
|
|
$db = DB::getDB();
|
|
$db = DB::getDB();
|
|
|
if ($db->has_errors()) {
|
|
if ($db->has_errors()) {
|
|
|
throw new Exception("DB Errors: " . implode("\n<br>", $db->get_errors()));
|
|
throw new Exception("DB Errors: " . implode("\n<br>", $db->get_errors()));
|
|
@@ -103,9 +104,11 @@ jQuery(document).ready(function () {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function reinstallAction() {
|
|
public function reinstallAction() {
|
|
|
- // TODO: reinstall triggers for after insert/update `IN7_MK_BAZA_DYSTRYBUCJI`?
|
|
|
|
|
- // TODO: reinstall triggers for after insert/update `IN7_DZIENNIK_KORESP` and `PROBLEMS`?
|
|
|
|
|
- // coalesce((select p.`path` from `IN7_MK_BAZA_DYSTRYBUCJI` p where p.`ID`=4480 limit 1), 'Brak projektu')
|
|
|
|
|
|
|
+ $this->reinstall();
|
|
|
|
|
+ die('OK');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function reinstall() {
|
|
|
$sqlList = array();
|
|
$sqlList = array();
|
|
|
$sqlList['RemoveTable'] = "DROP TABLE IF EXISTS `_project_path_idx`";
|
|
$sqlList['RemoveTable'] = "DROP TABLE IF EXISTS `_project_path_idx`";
|
|
|
$sqlList['InstallTable'] = "
|
|
$sqlList['InstallTable'] = "
|
|
@@ -148,11 +151,11 @@ jQuery(document).ready(function () {
|
|
|
|
|
|
|
|
update `IN7_MK_BAZA_DYSTRYBUCJI` p join `_project_path_idx` i on(i.`ID`=p.`ID`)
|
|
update `IN7_MK_BAZA_DYSTRYBUCJI` p join `_project_path_idx` i on(i.`ID`=p.`ID`)
|
|
|
set p.`path`=i.`idx_PATH`;
|
|
set p.`path`=i.`idx_PATH`;
|
|
|
- update `IN7_DZIENNIK_KORESP` k join `_project_path_idx` i on(i.`ID`=k.`ID_PROJECT`)
|
|
|
|
|
- set k.`path`=i.`idx_PATH`;
|
|
|
|
|
|
|
+ update `IN7_DZIENNIK_KORESP` k left join `_project_path_idx` i on(i.`ID`=k.`ID_PROJECT`)
|
|
|
|
|
+ set k.`path`=coalesce(i.`idx_PATH`, '?');
|
|
|
-- TODO: update `PROBLEMS` if exists
|
|
-- TODO: update `PROBLEMS` if exists
|
|
|
- update `PROBLEMS` pr join `_project_path_idx` i on(i.`ID`=pr.`ID_PROJECT`)
|
|
|
|
|
- set pr.`ID_PROJECT_path`=i.`idx_PATH`;
|
|
|
|
|
|
|
+ update `PROBLEMS` pr left join `_project_path_idx` i on(i.`ID`=pr.`ID_PROJECT`)
|
|
|
|
|
+ set pr.`ID_PROJECT_path`=coalesce(i.`idx_PATH`, '?');
|
|
|
END ;
|
|
END ;
|
|
|
";
|
|
";
|
|
|
$sqlList['RemoveTrigger_BeforeInsertProject'] = "DROP TRIGGER IF EXISTS `_IN7_MK_BAZA_DYSTRYBUCJI_tree_INSERT`";
|
|
$sqlList['RemoveTrigger_BeforeInsertProject'] = "DROP TRIGGER IF EXISTS `_IN7_MK_BAZA_DYSTRYBUCJI_tree_INSERT`";
|
|
@@ -331,7 +334,6 @@ jQuery(document).ready(function () {
|
|
|
throw new Exception("DB Errors at sql '{$sqlName}': " . implode("\n<br>", $db->get_errors()));
|
|
throw new Exception("DB Errors at sql '{$sqlName}': " . implode("\n<br>", $db->get_errors()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- die('OK');
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|