* -- {tablename}_trigger_{optional_string}_before_update_{column_name}(OLD.column, NEW.column}
* -- {tablename}_trigger_{optional_string}_before_insert_{column_name}(OLD.column}
*
- *
*
+ * ------- Importing with triggers disabled.
+ *
+ * SET @DISABLE_TRIGGER=1; (or anything you like except NULL)
+ * do imports
+ * SET @DISABLE_TRIGGER=NULL;
+ *
+ * ------ Call a method disabling a particular set of triggers
+ * SET @DISABLE_TRIGGER_the_table_name=1; (or anything you like except NULL)
+ * do action
+ * SET @DISABLE_TRIGGER_the_table_name=NULL;*
*/
class Pman_Core_UpdateDatabase_MysqlLinks {
$this->updateTableComments();
$this->updateCharacterSet();
+ $this->updateEngine();
$ff = HTML_FlexyFramework::get();
if (!empty($ff->Pman['enable_trigger_tests'])) {
BEFORE DELETE ON `{$target_table}`
FOR EACH ROW
BEGIN
- DECLARE mid INT(11);
-
+ DECLARE mid INT(11);
+ IF (@DISABLE_TRIGGER IS NULL AND @DISABLE_TRIGGER_{$target_table} IS NULL ) THEN
";
foreach($sources as $source=>$target) {
}
$trigger .= "
+ END IF;
END
";
FOR EACH ROW
BEGIN
DECLARE mid INT(11);
-
+ IF (@DISABLE_TRIGGER IS NULL AND @DISABLE_TRIGGER_{$tbl} IS NULL ) THEN
";
foreach($map as $source_col=>$target) {
}
$trigger .= "
+ END IF;
END
";
FOR EACH ROW
BEGIN
DECLARE mid INT(11);
-
+ IF (@DISABLE_TRIGGER IS NULL AND @DISABLE_TRIGGER_{$tbl} IS NULL ) THEN
";
foreach($map as $source_col=>$target) {
}
$trigger .= "
+ END IF;
END
";
return $ret;
}
- function updateCharacterSet()
- {
- DB_DataObject::debugLevel(1);
- foreach (array_keys($this->schema) as $tbl){
-
- if(strpos($tbl, '__keys') !== false ){
- continue;
- }
-
- echo "CALL mysql_change_charset('{$tbl}') \n";
- DB_DataObject::factory('core_enum')->query("CALL mysql_change_charset('{$tbl}')");
- }
- }
+
}