Process/FixMysqlCharset.php
authorAlan <alan@roojs.com>
Wed, 23 Aug 2023 02:22:13 +0000 (10:22 +0800)
committerAlan <alan@roojs.com>
Wed, 23 Aug 2023 02:22:13 +0000 (10:22 +0800)
Process/FixMysqlCharset.php

index f105ee7..bb0cbe0 100644 (file)
@@ -43,6 +43,9 @@ class Pman_Core_Process_FixMysqlCharset extends Pman_Core_Cli {
         }
         touch('/tmp/fix_mysql_charset_'. $opts['table']);
         
+        $this->disableTriggers($opts['table']);
+        $this->enableTriggers($opts['table']);
+        
         $t = DB_DataObject::factory($opts['table']);
         $cols = $t->tableColumns();
         $t->selectAdd();
@@ -98,4 +101,13 @@ class Pman_Core_Process_FixMysqlCharset extends Pman_Core_Cli {
          
         exit;
     }
+    
+    function disabletriggers($tbl)
+    {
+        $t = DB_DataObject::factory($tbl);
+        $t->query("SHOW TRIGGERS FROM {$t->databaseName()} where `table` = '{$tbl}");
+        $t->find();
+        $ar = $t->fetchAll();
+        print_r($ar);exit;
+    }
 }