saelker/migrations-bundle

Symfony Bundle to handle migrations between multiple bundles

Installs: 9 302

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0

Type:symfony-bundle

v2.1.1 2023-08-22 06:39 UTC

README

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