/** * {@inheritdoc} */ public function alterIndex(AbstractTable $table, AbstractIndex $initial, AbstractIndex $index) { $query = \Spiral\interpolate("ALTER TABLE {table} DROP INDEX {index}, ADD {statement}", ['table' => $table->getName(true), 'index' => $initial->getName(true), 'statement' => $index->sqlStatement(false)]); $this->run($query); return $this; }
/** * {@inheritdoc} */ protected function doIndexChange(AbstractIndex $index, AbstractIndex $dbIndex) { $query = \Spiral\interpolate("ALTER TABLE {table} DROP INDEX {original}, ADD {statement}", ['table' => $this->getName(true), 'original' => $dbIndex->getName(true), 'statement' => $index->sqlStatement(false)]); $this->driver->statement($query); }
/** * Driver specific index remove (drop) command. * * @param AbstractTable $table * @param AbstractIndex $index * @return self */ public function dropIndex(AbstractTable $table, AbstractIndex $index) { $this->run("DROP INDEX {$index->getName(true)}"); return $this; }
/** * Driver specific index remove (drop) command. * * @param AbstractIndex $index */ protected function doIndexDrop(AbstractIndex $index) { $this->driver->statement("DROP INDEX {$index->getName(true)}"); }
/** * Register new index element. * * @param AbstractIndex $index * @return AbstractIndex */ protected function registerIndex(AbstractIndex $index) { $this->indexes[$index->getName()] = $index; return $index; }