예제 #1
0
 /**
  * @return boolean
  */
 public function executeDbdeploy()
 {
     $sql = '';
     foreach ($this->getMissingIndexesByTable() as $tableName => $missingIndexes) {
         foreach ($missingIndexes as $foreignKeyColumns) {
             $sql .= $this->db->generateCreateIndexStatement($tableName, $foreignKeyColumns) . PHP_EOL;
         }
         $sql .= $this->db->generateAnalyzeTableStatement($tableName) . PHP_EOL;
         $sql .= PHP_EOL;
     }
     if (1 || $sql) {
         $this->writeDbdeployFile('-- Generated by db-foreign-key-indexes Dewdrop CLI command' . PHP_EOL . PHP_EOL . $sql);
     }
     return true;
 }