2017 © Pedro Peláez
 

symfony-bundle migrations-bundle

Mantainance project of old ZenstruckMigrationsBundle

image

smartteam/migrations-bundle

Mantainance project of old ZenstruckMigrationsBundle

  • Thursday, January 18, 2018
  • by blacksun
  • Repository
  • 1 Watchers
  • 0 Stars
  • 271 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 10 Versions
  • 15 % Grown

The README.md

SmartTeamMigrationsBundle

Mantainance project of old ZenstruckMigrationsBundle that enabled container aware migrations., (*1)

NOTE: For use with Symfony 2.0 use the 1.x branch, (*2)

Installation

  1. Add to composer.json (see http://getcomposer.org/), (*3)

    "require" :  {
        "smartteam/migrations-bundle": "*",
    }
    
  2. Register the bundle, (*4)

    <?php
    // app/AppKernel.php
    
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new SmartTeam\Bundle\MigrationsBundle\SmartTeamMigrationsBundle(),
        );
        // ...
    )
    

Usage

  • To make use of container aware data migrations your migrations must extend SmartTeam\Bundle\MigrationsBundle\Migrations\AbstractMigration. (note: Migrations that extend Doctrine\DBAL\Migrations\AbstractMigration will still run normally)
  • Implement the dataUp() method and add your custom migration logic. (note: The up() method will be run before dataUp)
  • Implement the dataDown() method and add your custom migration logic. (note: The down() method will be run before dataDown)
  • Optionally implement the getDataDescription method and return a description of the migration.
  • Migrate using the smartteam:migrations:migrate command. (note: make sure you run migrations with this command and not doctrine:migrations:migrate

Migration Template

<?php

namespace Application\Migrations;

use SmartTeam\Bundle\MigrationsBundle\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * Auto-generated Migration: Please modify to your need!
 */
class Version20120419113825 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        // this up() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

    }

    public function down(Schema $schema)
    {
        // this down() migration is autogenerated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");

    }

    public function dataUp(ContainerInterface $container)
    {
        // container aware logic
    }

    public function dataDown(ContainerInterface $container)
    {
        // container aware logic
    }

    /**
     * OPTIONAL
     */
    public function getDataDescription()
    {
        return parent::getDataDescription();
    }
}

The Versions

18/01 2018

dev-master

9999999-dev http://zenstruck.com/project/ZenstruckMigrationsBundle

Mantainance project of old ZenstruckMigrationsBundle

  Sources   Download

MIT

The Requires

 

by Gabriele Santini

migrations

18/01 2018

v2.2.0

2.2.0.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Mantainance project of old ZenstruckMigrationsBundle

  Sources   Download

MIT

The Requires

 

by Gabriele Santini

migrations

11/01 2013

v2.1.1

2.1.1.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

11/01 2013

1.x-dev

1.9999999.9999999.9999999-dev http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

11/01 2013

v1.2.1

1.2.1.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

30/11 2012

v2.1.0

2.1.0.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

30/11 2012

v1.2.0

1.2.0.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

22/11 2012

v2.0.0

2.0.0.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

02/11 2012

v1.1.0

1.1.0.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations

09/08 2012

v1.0.0

1.0.0.0 http://zenstruck.com/project/ZenstruckMigrationsBundle

Wrapper for DoctrineMigrationsBundle that enables container aware migrations

  Sources   Download

MIT

The Requires

 

migrations