PHPackages                             fiisoft/phinx - 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. [Database &amp; ORM](/categories/database)
4. /
5. fiisoft/phinx

ActiveLibrary[Database &amp; ORM](/categories/database)

fiisoft/phinx
=============

Console-commands to use Phinx's library console-commands in custom console application (based on symfony/console package).

1.9.2(8y ago)139MITPHPPHP &gt;=5.6.0

Since Oct 8Pushed 8y agoCompare

[ Source](https://github.com/fiiSoft/fiisoft-phinx)[ Packagist](https://packagist.org/packages/fiisoft/phinx)[ Docs](https://github.com/fiiSoft/fiisoft-phinx)[ RSS](/packages/fiisoft-phinx/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (3)Versions (16)Used By (0)

FiiSoft Phinx
=============

[](#fiisoft-phinx)

Console-commands to use Phinx's library console-commands in custom console application (based on symfony/console package).

My advice is - do not use it unless you are enough strong mentally to immune for such bad code.

---

It contains wrappers for Phinx's commands:

- breakpoint
- create
- migrate
- rollback
- seed:create
- seed:run
- status
- test

It also contains six special commands (not available in Phinx):

- mark - marks migration as migrated without migrating it (adds entry log to phinxlog so migration seems to be already migrated)
- unmark - removes entry log from phinxlog, without rollback on migration (so migration will be migrated on next migrate)
- repeat - repeats single migration (specified by its version number) even if migrated
- revoke - performs rollback on single migration (specified by its version number)
- remove - removes entry log from phinxlog and deletes corresponding migration file from disk
- cleanup - removes entries of missing migrations from phinxlog (if files are not available)

In addition, it comes with special generic-purpose command phinx which allows to run other Phinx-specific commands in special way.

---

Keep in mind that this library uses its own configuration-schema as well as template for migrations classes and base abstract class for them.

The main goal of this custom configuration is to manage migrations for many destiny databases (in various environments). Therefore configurations are grouped in something called "destiny".

Here are some examples.

- The simplest possible (aka minimal required) configuration:

```
$config = new PhinxConfig([
    'local' => [
        'environments' => [
            'dev' => [
                'adapter' => 'pgsql',
                'host' => 'localhost',
                'name' => 'dbname',
                'user' => 'username',
                'pass' => 'password',
            ]
        ],
    ]
]);
```

This creates config for one destiny called *local* with one environment *dev*. Migration files for this destiny will be stored in `(current working directory)/phinx/local/migrations` directory. Notice that the name of destiny becames part of path.

- Similar configuration but with path to files with migrations in specified directory without name of destiny:

```
$config = new PhinxConfig([
    'local' => [
        'paths_root' => __DIR__ . DIRECTORY_SEPARATOR . 'phinx',
        'environments' => [
            'dev' => [
                'adapter' => 'pgsql',
                'host' => 'localhost',
                'name' => 'dbname',
                'user' => 'username',
                'pass' => 'password',
            ]
        ],
    ]
]);
```

In this case path to migration files is `__DIR__/phinx/migrations` - there is no name of destiny *local* in path.

- Third way to create the simplest configuration is to specify path to directory with migrations like this:

```
$config = new PhinxConfig([
    'defaults' => [
        'phinx_files' => __DIR__ . DIRECTORY_SEPARATOR . 'dev',
    ],
    'local' => [
        'environments' => [
            'dev' => [
                'adapter' => 'pgsql',
                'host' => 'localhost',
                'name' => 'dbname',
                'user' => 'username',
                'pass' => 'password',
            ]
        ],
    ]
]);
```

This defines root folder for all *destinations*. The path for migration files for *local* is now `__DIR__/dev/local/migrations`.

---

To handle various different sets of migrations reffered to the same database, use:

```
$config = new PhinxConfig([
    'defaults' => [
        'adapter' => 'pgsql',
        'host' => 'localhost',
        'name' => 'dbname',
        'user' => 'username',
        'pass' => 'password',
    ],
    'alpha' => [
      'environments' => [
          'dev' => [
          ],
      ],
    ],
    'bravo' => [
      'environments' => [
          'dev' => [
          ],
          'default_migration_table' => 'phinx_migrations',
      ],
    ],
];
```

This configuration defines two *destinations*: *alpha* and *bravo*.

Migration files for *alpha* will be stored in `(current working directory)/phinx/alpha/migrations`and the name of the table used by Phinx will be `phinxlog` (as default).

Migration files for *bravo* will be stored in `(current working directory)/phinx/bravo/migrations`and the name of the table used by Phinx will be `phinx_migrations`.

Because there are no other data specified, both *destinations* will share the same database, so it gives possibility to handle various sets of migrations for the same database.

---

There is also a bin/finx executable file provided with library. Usage of it is a bit hard to explain because it uses its own schema of arguments.

Some examples (lets assume the *local* destination is defined in configuration):

- `bin/finx list` show list of available commands
- `bin/finx` the same as above (command list is default)
- `bin/finx phinx` show help for generic command (phinx)
- `bin/finx phinx local status` show status of migrations from destiny *local*
- `bin/finx phinx local` the same as above (command status is default)
- `bin/finx local` the same as above (status is default, keyword phinx can be omitted)
- `bin/finx phinx:status local` the same as above (by direct call of command status)

Some examples of call command *migrate* with environment *dev* from destination *local*, in different ways (and all do exactly the same!):

- `bin/finx phinx local migrate -e dev`
- `bin/finx phinx local dev migrate`
- `bin/finx phinx local migrate`
- `bin/finx phinx:migrate local -e dev`
- `bin/finx phinx:migrate local dev`
- `bin/finx phinx:migrate local`
- `bin/finx local migrate -e dev`
- `bin/finx local dev migrate`
- `bin/finx local migrate` (this one I prefer)

As you can see, it's a bit crazy.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~20 days

Total

15

Last Release

3005d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8c5209d42ffa9f8533c43f838198777611688b96ab4e0a95f38009db56fdb97?d=identicon)[fiisoft](/maintainers/fiisoft)

---

Top Contributors

[![fiiSoft](https://avatars.githubusercontent.com/u/27871508?v=4)](https://github.com/fiiSoft "fiiSoft (15 commits)")

---

Tags

consolemigrationphinx

### Embed Badge

![Health badge](/badges/fiisoft-phinx/health.svg)

```
[![Health](https://phpackages.com/badges/fiisoft-phinx/health.svg)](https://phpackages.com/packages/fiisoft-phinx)
```

###  Alternatives

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[odan/phinx-migrations-generator

Migration generator for Phinx

235847.8k23](/packages/odan-phinx-migrations-generator)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2592.8M263](/packages/ssch-typo3-rector)[bizley/migration

Migration generator for Yii 2.

297374.3k11](/packages/bizley-migration)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

134391.5k12](/packages/rector-rector-src)[dmstr/yii2-migrate-command

Console Migration Command with multiple paths/aliases support

31295.5k6](/packages/dmstr-yii2-migrate-command)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
