src/Deploys/Deployer.php
protected function runClearDatabaseIndexs()
    {
        foreach ($this->collections as $coll => $activated) {
            $indexs = db()->getIndexs($coll);

            // Carregar lista de colecoes que sobraram no banco
            $diff = Arr::where($indexs, function($item) use ($activated) {
                return ((! in_array($item, $activated)) && ($item != '_id_'));
            });

            // Excluir indices que sobraram
            foreach ($diff as $diffIndex) {
                $this->note("<comment>Index droping:</comment> {$coll}.{$diffIndex}");
                db()->dropIndex($coll, $diffIndex);
                $this->note("<comment>Index droped:</comment> {$coll}.{$diffIndex}");
            }
        }
    }
protected function runClearDatabaseIndexs()
    {
        foreach ($this->collections as $coll => $activated) {
            $indexs = db()->getIndexs($coll);

            // Carregar lista de colecoes que sobraram no banco
            $diff = Arr::where($indexs, function($item) use ($activated) {
                return ((! in_array($item, $activated)) && ($item != '_id_'));
            });

            // Excluir indices que sobraram
            foreach ($diff as $diffIndex) {
                $this->note("<comment>Index droping:</comment> {$coll}.{$diffIndex}");
                db()->dropIndex($coll, $diffIndex);
                $this->note("<comment>Index droped:</comment> {$coll}.{$diffIndex}");
            }
        }
    }
protected function runClearDatabaseIndexs ( ) { foreach ( $ this -> collections as $ coll => $ activated ) { $ indexs = db ( ) -> getIndexs ( $ coll ) ; // Carregar lista de colecoes que sobraram no banco $ diff = Arr :: where ( $ indexs , function ( $ item ) use ( $ activated ) { return ( ( ! in_array ( $ item , $ activated ) ) && ( $ item != '_id_' ) ) ; } ) ; // Excluir indices que sobraram foreach ( $ diff as $ diffIndex ) { $ this -> note ( "<comment>Index droping:</comment> {$coll}.{$diffIndex}" ) ; db ( ) -> dropIndex ( $ coll , $ diffIndex ) ; $ this -> note ( "<comment>Index droped:</comment> {$coll}.{$diffIndex}" ) ; } } }
Run clear database indexs.
Run clear database indexs .