Componette

Componette

nextras

nextras / migrations v3.6.0

Powerful database migrations focused on reliability

download-cloud-line composer require nextras/migrations

Nextras Migrations

Build Status Downloads this Month Stable Version

For more information read documentation.

Supported databases:

  • PostgreSQL
  • MySQL

Supported DBALs:

Development & Running Integration Tests in Docker

  1. Create ./tests/*.ini files
    cp tests/php.docker.ini tests/php.ini
    cp tests/drivers.docker.ini tests/drivers.ini
  2. Start containers
    docker-compose up --detach
  3. Run tests
    tests/run-in-docker.sh php84 tests/run-integration.sh

License

Based on Clevis\Migration by Petr Procházka and further improved.

New BSD License. See full license.

  • v3.6.0 3.6.0

    • fix Doctrine ORM 3 structure diffs dropping all unmapped tables and sequences, including the migrations table (reported by @ondraondra81 in #158). Generated migrations now never drop tables or sequences that are not mapped to entities, as with ORM 2, so tables of removed entities have to be dropped manually. On ORM 3, foreign keys from mapped to unmapped tables are still dropped.
    • add support for nette/di 3.1 and 3.2, including dynamic parameters in dir and group directory
    • add support for PHP 8.5 and 8.6

    Backported in #166

  • v3.5.0 3.5.0

    • add support for Symfony 8 in #150
  • v3.4.0 3.4.0

    • add support for Doctrine ORM 3.x & DBAL 4.x by @xificurk in #140
    • add support for PHP 8.4
  • v3.3.1 3.3.1

    • fix when running migrations in non-cli SAPI
  • v3.3.0 3.3.0

    • add support for Symfony 7
    • add support for dibi 5
    • remove support for PHP < 7.1
    • remove support for nette/di 2.3
    • remove support for nette/database 2.2
    • remove support for dibi 2
  • v3.2.0 3.2.0

    • add PsrLogPrinter for sending Nextras Migrations output to Psr\Log\LoggerInterface
      You can enable it by adding printer: psrLog to either Nette or Symfony configuration.
    • add support for Symfony 6.x
    • Symfony Console commands no longer require nette/utils
  • v3.1.6 3.1.6

    • fix nextras/dbal 5.x compatibility
  • v3.1.5 3.1.5

    • fix doctrine/dbal 3.x compatibility
  • v3.1.3 3.1.3

    • fix parsing of SQL with consecutive delimiters
  • v3.1.2 3.1.2

    • fix compatibility with Symfony 4.4 and 5.0
    • fix init command
  • v3.1.1 3.1.1

    • fix parsing of SQL with comment on last line which is not followed by newline [#102]
  • v3.1.0 3.1.0

    New Features

    • implemented support for migrations generators (IDiffGenerator),
      with Doctrine ORM SchemaTool
    • added NextrasMigrationsBundle for Symfony
    • extracted groups & extension handlers configuration to IConfiguration interface
    • added elapsed time & number of queries to console output
    • exception message for changed migrations contain old and new hashes
    • CreateCommand: added support for nested directory structure
    • CreateCommand: prints path to created file to stdout
    • removed strict order requirement for independent groups
    • improved SQL parsing for import
    • SymfonyConsole: support lazy loading of commands

    New Integrations

    • added support for Nette Database 3
    • added support for Nette DI 3
    • added support for Symfony 3 and 4
    • added support for dibi 3 and 4

    BC Breaks

    • Symfony commands: removed --production option,
      use withDummyData option in config.neon or setup IConfiguration option instead
    • Symfony commands: changed constructor to accept IConfiguration instance instead of $dir and $phpParams
    • IPrinter: changed printExecute() signature to accept elapsed time as well d088b24
    • IPrinter: printReset replaced with printIntro 960b008

    For the details you can have a look at the diff.

  • v3.0.5 3.0.5

    • fixed compatibility with Symfony Console 3.x
    • fixed problem with lock name in MySQL 5.7.5+
    • fixed releasing lock that was not acquired

    For the details you can have a look at the diff.

  • v3.1.0-rc3 3.1.0 RC3

    Changes since RC2:

    • improved docs about dummy data
    • improved SQL parsing for import
    • fixed creating locks with too long names
  • v3.1.0-rc2 3.1.0 RC2

    New Features

    • implemented support for migrations generators (IDiffGenerator),
      with Doctrine ORM SchemaTool
    • extracted groups & extension handlers configuration to IConfiguration interface,
      defaults to DefaultConfiguration
    • added elapsed time & number of queries to console output
    • exception message for changed migrations contain old and new hashes
    • CreateCommand: added support for nested directory structure
    • CreateCommand: prints path to created file to stdout
    • removed strict order requirement for independent groups

    BC Breaks

    • Symfony commands: removed --production option,
      use withDummyData option in config.neon or setup IConfiguration option instead
    • Symfony commands: changed constructor to accept IConfiguration instance instead of $dir and $phpParams
    • IPrinter: changed printExecute() signature to accept elapsed time as well d088b24
    • IPrinter: printReset replaced with printIntro 960b008
  • v3.1.0-beta2 3.1.0 beta 2

    • added IConfiguration interface, used by Symfony Console commands
    • implemented support for arbitrary migrations generators with IDiffGenerator interface
    • added integration with Doctrine ORM SchemaTool
    • removed strict order requirement for independent groups

    and more

  • v3.0.2 3.0.2

    • fixed case-sensitivity of namespace in DoctrineAdapter
  • v3.0.3 3.0.3

    • fixed incorrect error message when migration file was empty
  • v3.0.4 3.0.4

    • fixed compatibility with Nextras DBAL 2.0
    • fixed MySQL database locks when executing migrations on multiple different databases in parallel
  • v3.1.0-beta1 3.1.0-beta1

    3.1.0-beta1 is out! What's changed?

    • BC Breaks:
      • changed interface IPrinter [960b008]
    • new features:
      • create command respectis sub directories;
      • create command prints the created filename;
      • handlers can be defined in config;
      • cli output contains elapsed time, number of queries and enhanced readability;
      • if migrations changed, this old and new hashes are included in the exception message;
    • fixes & changes:
      • other minor fixes and enhancements;
    • see full commit changelog
  • v3.0.1 3.0.1

    • simplified changing default PostgreSQL's schema
    • fixed reset failing to create PostgreSQL's schema
    • fixed wrong order of migrations when files had identical logical names
  • v3.0.0 3.0.0

    New features

    • Written documentation
    • Added built-in Symfony Commands.
    • Added support for Nextras DBAL, Doctrine DBAL and dibi.
    • Added support for deep directory structure, i.e. the following paths are now considered equal
      • /migrations/structures**/**2015-03-16-170342-languages.sql
      • /migrations/structures**/2015/**03-16-170342-languages.sql
      • /migrations/structures**/2015/03/**16-170342-languages.sql
      • /migrations/structures**/2015/**2015-03-16-170342-languages.sql
      • /migrations/structures**/2015/03/**2015-03-16-170342-languages.sql

    Changes

    • Minimum PHP version changed to 5.4
    • New migration in the middle of existing migrations will now result in error.
    • Deprecated the following classes:
      • Nextras\Migrations\Extensions\DbPhp,
        use Nextras\Migrations\Extensions\PhpHandler
      • Nextras\Migrations\Extensions\SimplePhp,
        use Nextras\Migrations\Extensions\PhpHandler
      • Nextras\Migrations\Extensions\NetteDbSql,
        use Nextras\Migrations\Extensions\SqlHandler
      • Nextras\Migrations\Drivers\MySqlNetteDbDriver,
        use Nextras\Migrations\Drivers\MySqlDriver with corresponding DBAL
      • Nextras\Migrations\Drivers\PgSqlNetteDbDriver,
        use Nextras\Migrations\Drivers\PgSqlDriver with corresponding DBAL
  • v3.0.0-rc2 3.0.0 RC2

    • fixed Doctrine support
  • v3.0.0-rc1 3.0.0 RC1

    New features

    • Written documentation
    • Added built-in Symfony Commands.
    • Added support for Nextras DBAL, Doctrine DBAL and dibi.
    • Added support for deep directory structure, i.e. the following paths are now considered equal
      • /migrations/structures**/**2015-03-16-170342-languages.sql
      • /migrations/structures**/2015/**03-16-170342-languages.sql
      • /migrations/structures**/2015/03/**16-170342-languages.sql
      • /migrations/structures**/2015/**2015-03-16-170342-languages.sql
      • /migrations/structures**/2015/03/**2015-03-16-170342-languages.sql

    Changes

    • Minimum PHP version changed to 5.4
    • New migration in the middle of existing migrations will now result in error.
    • Deprecated the following classes:
      • Nextras\Migrations\Extensions\DbPhp,
        use Nextras\Migrations\Extensions\PhpHandler
      • Nextras\Migrations\Extensions\SimplePhp,
        use Nextras\Migrations\Extensions\PhpHandler
      • Nextras\Migrations\Extensions\NetteDbSql,
        use Nextras\Migrations\Extensions\SqlHandler
      • Nextras\Migrations\Drivers\MySqlNetteDbDriver,
        use Nextras\Migrations\Drivers\MySqlDriver with corresponding DBAL
      • Nextras\Migrations\Drivers\PgSqlNetteDbDriver,
        use Nextras\Migrations\Drivers\PgSqlDriver with corresponding DBAL
price-tag-2-line

Badges

guide-fill

Dependencies

php (>=5.4)
Componette Componette felix@nette.org