PHP code example of gatherdigital / pimcore-migrations

1. Go to this page and download the library: Download gatherdigital/pimcore-migrations 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/ */

    

gatherdigital / pimcore-migrations example snippets



  return [
      "PimcoreMigrations" => TRUE
  ];



class MyMigrationClass1000 extends \PimcoreMigrations\Model\AbstractMigration 
{

    public function up()
    {
        \Pimcore\Db::get()->query("CREATE table `test`");
    }
    
    public function down()
    {
        \Pimcore\Db::get()->query("DROP table `test`");    
    }

}



php console.php deployment:migrations:status

php console.php deployment:migrations:up
or
php console.php deployment:migrations:up --fromVersion 1000 --toVersion 1001

php console.php deployment:migrations:down
or
php console.php deployment:migrations:down --fromVersion 1000 --toVersion 1001