Example #1
0
 public function dropIndex($index)
 {
     if (!$index instanceof Index) {
         $args = func_get_args();
         $type = array_shift($args);
         $columns = $args;
         $index = Index::create($columns)->setType($type);
     }
     if ($index->type === Index::TYPE_PRIMARY) {
         throw new Exception('Can not drop primary key', Exception::NOT_IMPLEMENTED);
     }
     if (isset($this->indexes[$index->getName()])) {
         unset($this->indexes[$index->getName()]);
     }
     return $this;
 }