public function dropPrimaryKey($name, $table) { echo " > drop primary key {$name} ..."; $time = microtime(true); $this->db->createCommand()->dropPrimaryKey($name, $table)->execute(); echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n"; }
/** * Builds and executes a SQL statement for dropping a primary key. * @param string $table the table that the primary key constraint will be removed from. * @param string $name the name of the primary key constraint to be removed. */ public function dropPrimaryKey($table, $name = null) { $name = $name ?: $this->getNamePrimaryKey($table); parent::dropPrimaryKey($name, $table); }