示例#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;
 }
示例#2
0
 /**
  * Driver specific index adding command.
  *
  * @param AbstractIndex $index
  */
 protected function doIndexAdd(AbstractIndex $index)
 {
     $this->driver->statement("CREATE {$index->sqlStatement()}");
 }
示例#3
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);
 }
示例#4
0
 /**
  * Driver specific index adding command.
  *
  * @param AbstractTable $table
  * @param AbstractIndex $index
  * @return self
  */
 public function addIndex(AbstractTable $table, AbstractIndex $index)
 {
     $this->run("CREATE {$index->sqlStatement()}");
     return $this;
 }