Download the PHP package roslov/migration-checker-bundle without Composer

On this page you can find all versions of the php package roslov/migration-checker-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package migration-checker-bundle

Database Migration Checker Bundle

Latest Stable Version Total Downloads License PHP Version Require

The Database Migration Checker Bundle validates Doctrine Migrations in Symfony by executing each migration up and down against a clean test database and ensuring the schema returns to the exact same state after the rollback. It wraps the core Migration Checker library and provides a ready-to-use Symfony console command.

This is intended for CI pipelines and local checks where you want confidence that every migration can be applied and reverted without leaving stray tables, columns, or indexes behind.

Requirements

Supported database types and versions

This bundle supports MySQL, MariaDB, PostgreSQL, and others.

See all supported database types and versions in the Migration Checker documentation.

Limitations

The console command migration-checker:check runs only in the test environment to avoid accidentally affecting the working database. Therefore, it should always be used with the option --env=test.

Installation

The package could be installed with composer:

If you are not using Symfony Flex, register the bundle manually:

Configuration

If you have a custom Doctrine setup, you can configure the entity manager and the migrations dependency factory. Create a configuration file config/packages/roslov_migration_checker.yaml:

General usage

What the checker does

For each new Doctrine migration, the checker will:

  1. Apply the migration (up).
  2. Roll it back (down).
  3. Compare the database schema before and after to ensure they match.
  4. Re-apply the migration to proceed to the next one.

If the schema differs after a rollback, the command fails and prints a unified diff of the schema changes.

Prerequisites

To get useful results, make sure:

Run locally

You can run the command to check your migrations:

Be careful to run it in the test environment, otherwise you can damage your data.

Also, ensure that you run this command on an empty database each time.

Successful output example

Failed output example

Run in CI

The following example spins up a MySQL container, waits for it to be ready, runs the check, and then cleans up. Adjust database credentials and the image name to match your project.

If you want to run it in your CI, you can do something like this:

Testing

Unit testing

The package is tested with PHPUnit. To run tests:

inside a container, or

Code style analysis

The code style is analyzed with PHP_CodeSniffer and PSR-12 Ext coding standard. To run code style analysis:

inside a container, or

from the host machine.

Static analysis

Static analysis is performed with PHPStan. To run it:

inside a container, or

from the host machine.

Full validation

To run all checks (PHP syntax, coding style, PHPStan, and Rector) at once:


All versions of migration-checker-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/doctrine-migrations-bundle Version ^3.2.1|^4.0
doctrine/orm Version ^2.0|^3.0
psr/log Version ^1.0|^2.0|^3.0
roslov/migration-checker Version ^1.0
sebastian/diff Version ^5.0|^6.0|^7.0|^8.0
symfony/config Version ^6.0|^7.0|^8.0
symfony/dependency-injection Version ^6.0|^7.0|^8.0
symfony/framework-bundle Version ^6.0|^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package roslov/migration-checker-bundle contains the following files

Loading the files please wait ...