Download the PHP package yousign/safe-migrations without Composer

On this page you can find all versions of the php package yousign/safe-migrations. 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 safe-migrations

🦺 safe-migrations

Make your migrations safe

🪄 Features

🤷 Why?

Because SQL migrations can execute heavy queries on database which can slow down your application.

⚙️ Config

*For a Symfony > 6.x

Install in your project

Declare the Middleware in your services.yaml

Create a migration template migration.php.tpl

Set this template as default for your migrations in doctrine_migrations.yaml

Enable the retry on lock through the env var in you .env<.environment>

That's it ☕

▶️ Usage

Migration class

When you generate a new migration, this one extend the Migration class of the library which expose the following safe methods.

Each of these methods will generate the right set of SQL requests to make the requested query safe.

Create table
Add foreign key
Rename constraint
Comment on column
Add index > Note: Adding an index on a table will execute an "analyze" on all columns of the table to update statistics
Drop index
Rename index
Add column
Drop column
Set default on column
Drop default on column
Set column nullable
Set column not nullable

Migration execution

If there is a lock while executing a Doctrine migration, the migration will throw a DriverException (Doctrine\DBAL\Driver\Exception).

If the SQLSTATE value is 55P03 (_lock_notavailable), the query will be retried up to 3 times with a 10s interval before throwing the thrown exception if it does not succeed.

You will get the following output:

Failed after the 3 retry
Succeed after 1 retry

📋 FAQ

Does it work with Migration bundle ? Yes, of course. There is no incompatibility between this library and the [doctrine/doctrine-migrations-bundle](https://symfony.com/bundles/DoctrineMigrationsBundle/current/index.html).

🔗 References

🤝 Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

After writing your fix/feature, you can run following commands to make sure that everything is still ok.

Authors


All versions of safe-migrations with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
doctrine/dbal Version ^3.7
doctrine/migrations Version ^3.3
symfony/string Version ^6.4|^7.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 yousign/safe-migrations contains the following files

Loading the files please wait ....