yii\db\Migration::dropIndex PHP Method

dropIndex() public method

Builds and executes a SQL statement for dropping an index.
public dropIndex ( string $name, string $table )
$name string the name of the index to be dropped. The name will be properly quoted by the method.
$table string the table whose index is to be dropped. The name will be properly quoted by the method.
    public function dropIndex($name, $table)
    {
        echo "    > drop index {$name} on {$table} ...";
        $time = microtime(true);
        $this->db->createCommand()->dropIndex($name, $table)->execute();
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  * Note: table will be auto pefixied if [[$autoWrapTableNames]] is true.
  */
 public function dropIndex($name, $table)
 {
     $table = $this->autoWrappedTableName($table);
     return parent::dropIndex($name, $table);
 }
All Usage Examples Of yii\db\Migration::dropIndex