Skip to content

Migrations Bundle, to handle migrations between multiple bundles

Notifications You must be signed in to change notification settings

Saelker/MigrationsBundle

Repository files navigation

Saelker Migrations Bundle

Update from 1.1.x => 1.2.x

Before updating to 1.2.x add to migration table the sequence column with type interger

Step 1: Install via Composer

composer reqire saelker/migrations-bundle

Step 2: Add to Your App Kernel

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Saelker\MigrationsBundle\SaelkerMigrationsBundle(),
    );
}

Step 3.1: Add Directories via config

# Saelker Migrations Directories
saelker_migrations:
    directories:
        - '%kernel.project_dir%/src/AppBundle/Migrations'
        ...

Step 3.2: Add Directories via CompilerPass

class SaelkerMigrationsBundle extends Bundle
{
    public function build(ContainerBuilder $container)
    {
         parent::build($container);

         $container->addCompilerPass(new MigrationsCompilerPass(__DIR__ . "/Migrations"));
    }
}

Step 4: Run first migration

bin/console saelker:migrations:migrate

Step 5: Generate new migration

bin/console saelker:migrations:generate

Step 6: Modify saved path depth

# Saelker Migrations Directories
saelker_migrations:
    clean_depth: 3
    directory_separator: '/'
    use_camel_case: false
    ignore_errors: false

About

Migrations Bundle, to handle migrations between multiple bundles

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages