Exemplo n.º 1
0
 private function getMissingIndexesByTable()
 {
     $missingIndexesByTable = [];
     foreach ($this->db->listTables() as $tableName) {
         $missingIndexes = $this->db->listMissingForeignKeyIndexes($tableName);
         if (count($missingIndexes)) {
             $missingIndexesByTable[$tableName] = $missingIndexes;
         }
     }
     return $missingIndexesByTable;
 }
Exemplo n.º 2
0
 public function testListTablesReturnsSingleColumnArrayWithTableNames()
 {
     $tables = $this->db->listTables();
     $stringValues = true;
     $numKeys = true;
     foreach ($tables as $key => $table) {
         if (!is_int($key)) {
             $numKeys = false;
         }
         if (!is_string($table)) {
             $stringValues = false;
         }
     }
     $this->assertTrue($numKeys);
     $this->assertTrue($stringValues);
     $this->assertTrue(in_array('dewdrop_test_fruits', $tables));
 }
Exemplo n.º 3
0
 /**
  * Check to see if the changelog table exists in the database already.
  *
  * @return bool
  */
 protected function tableExists()
 {
     return in_array($this->tableName, $this->dbAdapter->listTables());
 }