Esempio n. 1
0
 /**
  * {@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;
 }
Esempio n. 2
0
 /**
  * {@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);
 }
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 /**
  * Driver specific index remove (drop) command.
  *
  * @param AbstractIndex $index
  */
 protected function doIndexDrop(AbstractIndex $index)
 {
     $this->driver->statement("DROP INDEX {$index->getName(true)}");
 }
Esempio n. 5
0
 /**
  * Register new index element.
  *
  * @param AbstractIndex $index
  * @return AbstractIndex
  */
 protected function registerIndex(AbstractIndex $index)
 {
     $this->indexes[$index->getName()] = $index;
     return $index;
 }