/** * Method to test dropIndex(). * * @return void * * @covers Windwalker\Query\Mysql\MysqlQueryBuilder::dropIndex */ public function testDropIndex() { $expected = "DROP INDEX {$this->qn('bar')} ON {$this->qn('foo')}"; $actual = MysqlQueryBuilder::dropIndex('foo', 'bar'); $this->assertEquals($this->format($expected), $this->format($actual)); }
/** * dropIndex * * @param string $type * @param string $name * * @return mixed */ public function dropIndex($type, $name) { if ($type == Key::TYPE_PRIMARY) { $name = null; } $query = MysqlQueryBuilder::dropIndex($this->table, $type, $name); $this->db->setQuery($query)->execute(); return $this; }
/** * dropIndex * * @param string $name * * @return mixed */ public function dropIndex($name) { $query = MysqlQueryBuilder::dropIndex($this->table, $name); $this->db->setQuery($query)->execute(); return $this; }
/** * Method to test dropIndex(). * * @return void * * @covers Windwalker\Query\Mysql\MysqlQueryBuilder::dropIndex */ public function testDropIndex() { $expected = "ALTER TABLE {$this->qn}foo{$this->qn} DROP INDEX {$this->qn}bar{$this->qn}"; $actual = MysqlQueryBuilder::dropIndex('foo', 'INDEX', 'bar'); $this->assertEquals(\SqlFormatter::compress($expected), \SqlFormatter::compress($actual)); }