Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shopsys/migrations

[READ-ONLY] Command for transactional Doctrine migrations
https://github.com/shopsys/migrations

Last synced: about 1 month ago
JSON representation

[READ-ONLY] Command for transactional Doctrine migrations

Awesome Lists containing this project

README

        

## About

[![Downloads](https://img.shields.io/packagist/dt/shopsys/migrations.svg)](https://packagist.org/packages/shopsys/migrations)

This bundle provides commands which can be useful for database migrations:

- `shopsys:migrations:check-mapping` checks if ORM mapping is valid.
- `shopsys:migrations:check-schema` checks if database schema is satisfying ORM.
- `shopsys:migrations:count` returns count of migrations to execute.
- `shopsys:migrations:migrate` executes all database migrations in one transaction.
- the command supports installing migrations from multiple sources, so every bundle can have its own migrations
- it creates a `migration-lock.yml` file in the project's root, persisting the order of execution
- migrations can be manually reordered or skipped if necessary
- `shopsys:migrations:generate` generates database migrations if the schema was changed
- the command does not generate migrations that break backwards compatibility - eg. column dropping
- prompts you to choose the location for migration file if you are developing more than one bundle

This bundle uses [DoctrineMigrationsBundle](https://symfony.com/doc/current/bundles/DoctrineMigrationsBundle), so you have to install both.

This repository is maintained by [shopsys/shopsys] monorepo, information about changes is in [monorepo CHANGELOG.md](https://github.com/shopsys/shopsys/blob/master/CHANGELOG.md).

## To be able to use this bundle, you need to do following:

1. Require `shopsys/migrations` in `composer.json`
2. Register bundles in your `AppKernel.php`:

```
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Shopsys\MigrationBundle\ShopsysMigrationBundle(),
```

3. Configure `DoctrineMigrationsBundle` according to its documentation (see https://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html#configuration)

## Contributing

Thank you for your contributions to Shopsys Migrations package.
Together we are making Shopsys Platform better.

This repository is READ-ONLY.
If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare),
please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

Please, check our [Contribution Guide](https://github.com/shopsys/shopsys/blob/master/CONTRIBUTING.md) before contributing.

## Support

What to do when you are in troubles or need some help?
The best way is to join our [Slack](https://join.slack.com/t/shopsysframework/shared_invite/zt-11wx9au4g-e5pXei73UJydHRQ7nVApAQ).

If you want to [report issues](https://github.com/shopsys/shopsys/issues/new), please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

[shopsys/shopsys]: (https://github.com/shopsys/shopsys)