public static function synchronizeMigrations(CommandEvent $event)
    {
        $packages = $event->getComposer()->getRepositoryManager()
              ->getLocalRepository()->getPackages();
        $installer = $event->getComposer()->getInstallationManager();
        $appMigrationDir = self::getDestinationDir($event->getComposer());
        $io = $event->getIO();
        
        $areFileMigrated = array();
        
        //migrate for root package
        $areFileMigrated[] = self::handlePackage('.', 
              $event->getComposer()->getPackage(),
              $io, 
              $appMigrationDir);
        
        foreach($packages as $package) {
           $areFileMigrated[] = self::handlePackage($installer->getInstallPath($package),
                 $package,
                 $io, 
                 $appMigrationDir);
        }
        
        if (in_array(true, $areFileMigrated)) {
            $io->write("<warning>Some migration files have been imported. "
                  . "You should run `php app/console doctrine:migrations:status` and/or "
                  . "`php app/console doctrine:migrations:migrate` to apply them to your DB.");
        }
    }