Creates a new DropIndex object after assembling the passed
arguments.

@param Table $table The table where the index is
@param array $columns the indexed columns
@return DropIndex
183066
public static function build(Table $table, array $columns = [])
    {
        $index = new Index();
        $index->setColumns($columns);

        return new static($table, $index);
    }
185050
public function getDropTableSql($table)
    {
        $table = $this->buildRealTableName($table);
        return $this->getSchema()->getDropTableSql($table);
    }
1284730
public function dropIndex($columnName) {
        if (!in_array($columnName, $this->dropIndexes))
                $this->dropIndexes[] = $columnName;

        if (array_key_exists($columnName, $this->getReferences()))
                $this->dropReference($columnName);
        return $this;
    }
409367
public function dropIndex($collection, $columns)
    {
        $this->beginProfile($token = "    > drop index on " . $this->composeCollectionLogName($collection) . " (" . Json::encode((array) $columns) . ") ...");
        $this->db->getCollection($collection)->dropIndex($columns);
        $this->endProfile($token);
    }
8064
public static function dropIndex($table, $name)
    {
        $query = static::getQuery();

        return static::build(
            'DROP INDEX',
            $query->quoteName($name),
            'ON',
            $query->quoteName($table)
        );
    }
73217
public static function buildIndexDeclare($name, $columns, $table = null)
    {
        $query = static::getQuery();
        $cols = [];

        foreach ((array) $columns as $key => $val) {
            if (is_numeric($key)) {
                $vals = explode('(', $val);
                $key = $query->quoteName($vals[0]);

                if (isset($vals[1])) {
                    $key .= '(' . trim($vals[1], '()') . ')';
                }

                $cols[] = $key;
            } else {
                if (!is_numeric($val)) {
                    $string = is_string($val) ? ' ' . $query->quote($val) : '';

                    throw new \InvalidArgumentException(
                        sprintf(
                            'Index length should be number, (%s)%s given.',
                            gettype($val),
                            $string
                        )
                    );
                }

                $cols[] = $query->quoteName($key) . '(' . $val . ')';
            }
        }

        $cols = '(' . implode(', ', $cols) . ')';

        return static::build(
            $name ? $query->quoteName($name) : null,
            $table ? 'ON ' . $query->quoteName($table) : null,
            $cols
        );
    }
1023547
public function indexExists( $table, $columns = [ ] )
    {
        $indexes = $this->getTableIndexes( $table );

        $name = '';

        $this->prepareIndexName( $columns, $name );

        foreach ( $indexes as $index )
        {
            if ( $index === $name )
            {
                return TRUE;
            }
        }

        return FALSE;
    }
12011
public function drop($table = '')
    {
        $tableName = '';

        $tableName = ($table !== '') ?
            $table : $this->tableName;

        $this->schema = strtoupper(__FUNCTION__).' TABLE IF EXISTS
        `'.$this->database.'`.`'.$tableName.'`'.PHP_EOL;

        return $this;
    }
396776
public function dropTable($table)
    {
        $changeSetElt = $this->createChangeSet('drop-table-' . $table->getName());
        $dropTableElt = $this->document->createElement('dropTable');

        $tableName = QualifiedName::fromAsset($table);

        if ($tableName->getNamespaceName()) {
            $dropTableElt->setAttribute('schemaName', $tableName->getNamespaceName());
        }
        $dropTableElt->setAttribute('tableName', $tableName->getName());
        // Should we add cascadeConstraints attribute ?
        // $dropTableElt->setAttribute('cascadeConstraints', 'false');

        $changeSetElt->appendChild($dropTableElt);
        $this->root->appendChild($changeSetElt);
    }
565532
public function dropIndex($name, $table = null)
    {
        return $this->db->dropIndex($table, $name)
                        ->execute();
    }
1234563
public function columnsFrom($table, string $column, string ...$columns)
    {
        $this->from($table);

        list($tableAlias, $tableName) = $this->dialect()->parseTable($table);

        if (!$tableAlias) {
            $tableAlias = $tableName;
        }

        array_unshift($columns, $column);

        foreach ($columns as &$column) {
            $column = $tableAlias . '.' . $column;
        }
        unset($column);

        $this->columns(...$columns);

        return $this;
    }
949880
public function addIndex($columns)
    {
        $index = new Index($columns, $this);

        $this->actions[] =  function () use ($index) {
             return $this->manipulation->create($index);
        };

        return $this;
    }
583223
public function dropAndCreateTable(Table $table)
    {
        $this->tryMethod('dropTable', $table->getQuotedName($this->_platform));
        $this->createTable($table);
    }
643313
public function addIndex($columns, $name = null)
    {
        return $this->addKey(new Key(Key::TYPE_INDEX, (array) $columns, $name));
    }
577706
final public function dropIfExists($table)
    {
        $table = $this->getTablePrefixed($table);

        $sql = sprintf('DROP TABLE IF EXISTS `%s`;', $table);

        return $this->executeSqlQuery($sql);
    }
445705
protected function indexCommand($type, $columns, $index)
    {
        $columns = (array) $columns;

        // If no name was specified for this index, we will create one using a basic
        // convention of the table name, followed by the columns, followed by an
        // index type, such as primary or index, which makes the index unique.
        if (is_null($index)) {
            $index = $this->createIndexName($type, $columns);
        }

        return $this->addCommand($type, compact('index', 'columns'));
    }
852661
public function dropTable($table)
	{
		echo "    > drop table $table ...";
		$time=microtime(true);
		$this->getDbConnection()->createCommand()->dropTable($table);
		echo " done (time: ".sprintf('%.3f', microtime(true)-$time)."s)\n";
	}