PHPackages                             swisscom/commandmigration - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. swisscom/commandmigration

ActiveNeos-package[CLI &amp; Console](/categories/cli)

swisscom/commandmigration
=========================

Neos Flow package for framework based CLI command migrations

1.1.1(3y ago)635.9k↓47.8%4[1 issues](https://github.com/onivaevents/Swisscom.CommandMigration/issues)[2 PRs](https://github.com/onivaevents/Swisscom.CommandMigration/pulls)MITPHP

Since Mar 23Pushed 1y ago3 watchersCompare

[ Source](https://github.com/onivaevents/Swisscom.CommandMigration)[ Packagist](https://packagist.org/packages/swisscom/commandmigration)[ RSS](/packages/swisscom-commandmigration/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

Swisscom.CommandMigration
=========================

[](#swisscomcommandmigration)

Neos Flow package for framework based CLI command migrations.

The package allows to create migration scripts similar to Doctrine migrations. Contrary to executing SQL statements, it allows you to define versions with sets of Flow CLI commands. Those are executed when running the migration by the command `./flow commandmigration:migrate`.

This mainly solves the problem of executing one-off commands on distributed environments as well as different staging environments. Without this package, those one-off commands are possibly executed manually when needed, or are part of some other scripts in your deployment process. With this package, this becomes part of the code base. For integration, the migration command might be added to your deployment strategy the same way as the `./flow doctrine:migrate` command probably already is.

Usage
-----

[](#usage)

### Create migrations

[](#create-migrations)

To create a migration inherit from the `AbstractMigration` with the naming convention `VersionYmdHis` and implent the `up()` method. The class has to be within the namespace `Swisscom\CommandMigration` and be stored in your package under `Migrations/Command/`.

Example migration `Packages/Your.Package/Migrations/Command/Version20200220114245.php`:

```
