protected function insertDuplicatesToRemovalsTable($undedupedTable, $dedupedTable, $removalsTable)
 {
     $sql = 'INSERT INTO ' . $removalsTable . '(' . tickCommaSeperate($this->pdo->getColumns($undedupedTable)) . ') ';
     $sql .= 'SELECT * FROM ' . $undedupedTable . ' ';
     $sql .= 'WHERE id NOT IN ';
     $sql .= '(SELECT id FROM ' . $dedupedTable . ')';
     return $this->pdo->statement($sql);
 }
예제 #2
0
 public function createCompositeIndex($table, array $columns, $postfix = '')
 {
     $indexName = implode('_', $columns) . $postfix;
     $columns = tickCommaSeperate($columns);
     $sql = 'CREATE INDEX ' . $indexName . ' ON ' . $table . '(' . $columns . ')';
     $this->statement($sql);
 }