PHP code example of t4web / migrations

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

    

t4web / migrations example snippets


'migrations' => array(
    'dir' => dirname(__FILE__) . '/../../../migrations',
    'namespace' => 'T4web\Migrations',    
    'adapter' => 'Zend\Db\Adapter\Adapter',
    'show_log' => true
),



namespace T4web\Migrations;

use `T4web\Migrations\Migration\AbstractMigration;

class Version_20130403165433 extends AbstractMigration
{
    public static $description = "Migration description";

    public function up()
    {
        /** @var Zend\Db\ResultSet\ResultSet $result */
        //$result = $this->executeQuery(/*Sql instruction*/);
    }

    public function down()
    {
        //throw new \RuntimeException('No way to go down!');
        //$this->executeQuery(/*Sql instruction*/);
    }
}



namespace T4web\Migrations;

use T4web\Migrations\Migration\AbstractMigration;

class Version_20130403165433 extends AbstractMigration
{
    public static $description = "Migration description";

    public function up()
    {
         //$this->getServiceLocator()->get(/*Get service by alias*/);

    }

    public function down()
    {
        //$this->getServiceLocator()->get(/*Get service by alias*/);
    }
}