PHP code example of viosys / vio-db-migration

1. Go to this page and download the library: Download viosys/vio-db-migration library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

viosys / vio-db-migration example snippets




class Migrations_Migration100 extends \VioDbMigration\Components\Migrations\VioAbstractMigration
{
    public function up($modus)
    {
        $sql = "INSERT INTO ...";
        $this->addsql($sql);
    }
}

public function getDependendSwMigrationStep()
{
    return \Migrations_Migration920::class;
}

public function up($modus)
{
    $pm = $this->container->get('shopware_plugininstaller.plugin_manager');
    $pm->refreshPluginList();
    $VioVariantFilter = $pm->getPluginByName('FroshProfiler');
    if($VioVariantFilter){
        if($VioVariantFilter->getInstalled()){
            $pm->uninstallPlugin($VioVariantFilter);
        }
    }
}