sserbin/doctrine-migrations2-upgrade

Convert doctrine migrations files when upgrading from 1.x to 2.x

1.0 2019-02-02 01:36 UTC

README

Build Status Scrutinizer Code Quality Code Coverage

Intro

Doctrine migrations 2.0 introduced a number of BC breaks forcing users migrating from 1.x to adjust all of their previous migrations. This package aims to automate upgrading from 1.x to 2.0 by doing automatic code adjustments for your migration files.

The following bc breaks are covered:

  • exception class renames
  • main namespace rename
  • migration classes return type signature fix (for up(), down(), preUp(), postUp(), preDown(), postDown(), getDescription(), isTransactional())

Installation

composer require --dev sserbin/doctrine-migrations2-upgrade
# or globally
composer global require sserbin/doctrine-migrations2-upgrade

Usage

vendor/bin/migrations-upgrade path/to/migrations --dry-run
# or if installed globally (assuming global composer is in $PATH)
migrations-upgrade path/to/migrations --dry-run